photools.com Community

IMatch Bug Reports and Feature Requests => Bug Reports => Solved Bug Reports (for next version) => Topic started by: axel.hennig on June 24, 2024, 03:17:01 PM

Title: @CatNoRecurse in formula gets replicated
Post by: axel.hennig on June 24, 2024, 03:17:01 PM
I've got the following Category-tree:

sc1.jpg

The "test" category has the following formula:
"@CatNoRecurse[@All|Persons]"
If I click within "Properties" the three dots to edit the formula ("Edit Category Formula") and change the existing formula to:
"@CatNoRecurse[@All|Persons]" OR "Food"
Then clicking "Ok" closes the window without an error. Reopening the "Edit Category Formula" window shows the following:
"@CatNoRecurse[@All|Persons]" OR "@CatNoRecurse[Food]"
So the "@CatNoRecurse" part was added to "Food" without me doing anything.

This does not happen if I add the "Food" part before the other part, so:
"Food" OR "@CatNoRecurse[@All|Persons]"stays unchanged when closing and re-opening.
Title: Re: @CatNoRecurse in formula gets replicated
Post by: Mario on June 24, 2024, 03:54:52 PM
I'll look into it.
Word-around: "Food" OR "CatNo...
Title: Re: @CatNoRecurse in formula gets replicated
Post by: Mario on June 25, 2024, 10:13:57 AM
Found it. Fixed it.

The problem was caused by a flag that is set when @CatNoRecurse is encountered in the formulas token stream.
This flag was not reset when the next token was parsed. So the "Food" category was parsed as "regular group" but with the no recurse flag still set.

And when converting the parsed formula back into its string form, this caused "Food" to become "@CatNoRecurse[Food]".

Nice catch. Ancient bug.

Fixed for the next release.