jleenman
Forum Replies Created
-
Forum: Plugins
In reply to: [Visibility Logic for Elementor] User Meta error when meta doesn’t existThank you!
This has solved the issue for users that are not logged in.
The same error still happens when a user is logged in but the meta key doesn’t exist for that user. In my case I can write my code so that this shouldn’t happen, but maybe the team should consider adding a check for that case too.
I think that Visibility Logic should handle that case as if the array would exist but the value is not in it.
Thanks again for the help!
- This reply was modified 2 years ago by jleenman. Reason: marked as solved
Forum: Plugins
In reply to: [Visibility Logic for Elementor] User Meta error when meta doesn’t existMaybe this can be a feature request: an extra option in the User Meta section of Visibility Logic that determines how to handle a non-existing meta key.
Option: When the user meta does not exist (e.g. for guest visitors) the result of the condition is FALSE: -> Toggle (ON/off)
I need a solution sooner though (unless you can release such a feature fast ??
Forum: Plugins
In reply to: [Visibility Logic for Elementor] User Meta error when meta doesn’t existHi John,
The complete actual context of my site is quite complicated and not very useful to share here.
To reproduce you need at least Elementor and Visibility Logic.You can use Code Snippets to import this snippet: dropbox link.
Import the snippet in Code snippets and activate. It adds a very basic option page in the WordPress admin (Settings->Save User Meta) with a button to add example user meta for all users.Click the button ‘Update User Meta’ to add the user meta key.
(optionally you could use JSM’s Show User Metadata to verify that the key has been added to all user profiles, see image below. This plugin also makes it easy to remove the meta key: red icon)
Then create a page in Elementor, add any element and add these Visibility logic settings:
Verify that these settings work as intended by visiting the page as a logged-in user. The element should show. If you change ‘value_1’ to anything that’s not in the meta key (e.g. ‘value_4’) the element does not show.
Now for the error: visit the same page in incognito mode (or logged-out) to reproduce.
The same error happens if you now remove the meta key with JSM’s Show User Metadata or for any new user before you add the key with my snippet. It happens every time that the user meta key doesn’t exist, which from a technical viewpoint is to be expected.But with Visibility Logic I can’t figure out how to add a check to first verify if the user is logged-in, or to check if the key exists.
Conclusion: I need a way to use the User meta option of Visibility Logic, without breaking that page for logged-out users. In that case the condition result should be equal to ‘false’ (element not visible).
I had to restore a server backup and lost all changes since the last backup.
Haven’t found another solution, sorry =(
A full uninstall and reinstall did not fix the problem :S
Any suggestions on how I can reset all NGGallery options?
Feature request!
Another one looking ??