- Issue created by @debra-v
- πΊπΈUnited States DamienMcKenna NH, USA
Thank you for reporting the bug, I'm sorry we left that bug in the module and didn't catch it.
FYI the correct status for a new issue is "Active"; "needs work" is for when a solution has been proposed via a patch or merge request but it needs further work.
- πΉπΌTaiwan cobenash Taipei
Hey Folks,
I have the same issue. My environment is as follows:
* Drupal 10.4.2
* Block visibility group 2.0.4Thanks for the code provided by @debra-v
It works on my side, and I uploaded a patch regarding the proposed code.
So I changed the status from active to needs review. :)
- πΊπΈUnited States ccjjmartin Austin, TX
#5 fixes broken logic conditions for me, +1 RTBC
- π¨π¦Canada joelpittet Vancouver
The code differs significantly from the 2.1.x branch. Adding tests would help ensure this bug is fixed in both branches.
@cobenash, @proweb.ua, @ccjjmartin β would any of you be able to write a test to prevent regressions? A merge request would be preferred, but I appreciate the patch!
- First commit to issue fork.
- Merge request !26Issue #3503194: Visibility incorrectly returns false on OR logic when context... β (Open) created by b_sharpe
- π¨π¦Canada b_sharpe
Moved to MR, edited existing test to use two different contexts so that the AND/OR conditions are properly evaluated / tested.
Test fails without patch: https://git.drupalcode.org/issue/block_visibility_groups-3503194/-/jobs/...
Test passes with patch: https://git.drupalcode.org/issue/block_visibility_groups-3503194/-/jobs/...
- π¨π¦Canada joelpittet Vancouver
Wow, that was quick! Were you already working on the test, @b_sharpe?
I always hesitate to modify an existing test instead of adding a new one since thereβs a risk of losing valuable coverage. Itβs a bit tricky to tell if anything important is lost here, but seeing the red/green tests is definitely encouraging! Can you alleviate that worry?
- π¨π¦Canada b_sharpe
Ha, was actually just coincidence, I needed this to fix a prod instance today.
I would normally agree about a new test over editing; however, in this case the edit made more sense as the old test is for testing both AND/OR (
testMultipleConditions()
) and would have caught this issue in the first place had there been more than one context so I figured the edit made more sense.