Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.4.44 implemented #_IS_USER_IN_GROUP for Dynamic Groups but broke #_IS_USER_IN_GROUP for registered groups in EME #560

Closed
MichaelWybo opened this issue May 21, 2024 · 7 comments
Assignees

Comments

@MichaelWybo
Copy link

MichaelWybo commented May 21, 2024

Describe the bug
Hello Franky

Since 2.4.44 update
This line always return 0:

[eme_if tag='#_IS_USER_IN_GROUP{Admins,Agility,Chiots,GroupeA,GroupeB,GroupeC,Assistant,Moniteur}' value='0']

Fallback to 2.4.43 and its OK

image

@liedekef
Copy link
Owner

This should fix it:
312183c (1-line change in eme-people.php ==> if it does, please provide feedback)

@MichaelWybo
Copy link
Author

That helped for single group.
Found out that the problem is also the fact that there is more than 1 group

--> [eme_if tag='#_IS_USER_IN_GROUP{Admins,Moniteur,Assistant}' value='1'] --> Not Working
--> [eme_if tag='#_IS_USER_IN_GROUP{Admins}' value='1'] --> Working

@liedekef
Copy link
Owner

That seems to be working fine here ... can you test further with the just released version? Also: check your php error logfiles, if there's an issue some error (php or mysql) should be logged somewhere (if you log errors to file, which of course everyone should)

@MichaelWybo
Copy link
Author

Nothing specific in error_log

But I reverted this change: ef53a2f and it's working again with 2.4.45 and only this reverted change

@liedekef
Copy link
Owner

ok, I see ... it is because you specify the group names, not their id's. The old code worked unintentionally :-)
The change you reverted is ok, but less efficient if someone uses lots of group ids. This change should help too:

9823ff8

@MichaelWybo
Copy link
Author

I made the page that uses these placeholders long time ago, and the documentation (https://www.e-dynamics.be/wordpress/generic-placeholders/) say "called xxx" so i assumed that was only their names, not ids :)

Thanks for the modfication

@liedekef
Copy link
Owner

It might very well be that I did it like it was before just for this reason, but I didn't document it :-) So now the code is better documented too, this can now be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants