Conversation
|
@michael-milette I implemented it for ifingrouping, ifnotingrouping, ifingroup, ifnotingroup for now, but the new function is pretty much plug and play for the other if-tags |
…fnotactivitycompleted
|
Implemented for all relevant if tags known to me |
There was a problem hiding this comment.
Pull Request Overview
This PR addresses the mismatches in nested if-tags by updating the tag matching logic and adding extensive tests for ifingroup, ifingrouping, and related tags. Key changes include:
- Removal of an unused import for clarity.
- New tests for various nested conditions including partial tag scenarios, group membership, and profile checks.
- Expanded coverage of ifnotingroup/ifnotingrouping and ifactivitycompleted tags within the test suite.
Comments suppressed due to low confidence (1)
tests/filter_test.php:28
- The removal of the unused import statement 'use filter_filtercodes;' improves code clarity. Confirm that this change does not affect any indirect dependencies in the test suite.
-use filter_filtercodes;
|
@michael-milette Any updates? |
|
Hi @28Smiles , I am very interested in your PR. I think it would be an excellent addition to FilterCodes. However, due to the extensive changes and my busy work schedule, I haven't been able to dedicate the time necessary to review the changes before integrating them. Backwards compatibility is very important here. Out of curiosity, have you been using your patched version of FilterCodes? If so, did you experience any backwards compatibility issues where you might have had to go change existing usage of FilterCodes tags? Best regards, Michael |
|
We didnt adopt it yet, since we've been waiting for the merge, but we might start using it. I tried to be as compatible as possible, even wrinting some tests for regressions and basic functionality. |
{ifingroup a}{ifingroup b}Hello World{/ifingroup}{/ifingroup}->{/ifingroup}and so on lead to mismatches and wrong output. In stage one i added some tests for bug reproduction. Only nestings of the same filtercode category are affected.
I propose matching all nestings of groupings generating replacements for all tags at once, e.g.:
{ifingroup a}{ifingroup b}'/{ifingroup\s+a\}(.*)/{ifingroup\s+b\}(.*)\{\/ifingroup\}(.*)\{\/ifingroup\}/isuU''$1$2$3''$1$3'''''I will now implement a proof of concept