-
Notifications
You must be signed in to change notification settings - Fork 27
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
Accessing setting via FormIt hook always yields empty value #186
Comments
Definitely checked for typos in the key name? And it does work if you place the same snippet just on the page instead of as a hook? |
Hey Mark, I tested it as just a snippet and it also returns no value. I checked the name of the key a million times. If I call it using placeholder, it does render the value.
Swapping out the key name with a standard modx system setting returns a value. |
If I add the key as a placeholder in the template, then the snippet call on the same page also gets the value and outputs it to the modx log. Something weird going on, |
That sure does sound weird. Is this a global setting or a context-specific one that may be affected by #109? |
Event a simple snippet placed in the template like this returns nothing:
but the placeholder does: Both MODX events are activated on the plugin. The setting is a global setting. We are using language contexts. |
If you can email a login to [email protected], with a link to this issue, I'd like to do some debugging to see what might be going on there. Should have some spare time near the end of the week to take a look. |
I'm not sure if it's related, but in my case on the Contact-Form the "contact-mail" setting, which is also a ClientConfig-setting wouldn't work, unless I called it un-cached:
Just leaving it here for future problem-solvers. |
Summary
Trying to access a setting field using $modx->getOption() always returns an empty string.
Step to reproduce
Inside of a hook snippet try to call up a ClientConfig setting
Observed behavior
It returns empty
Expected behavior
It should return the saved value
Environment
ClientConfig version 2.3.0-pl, FormIt version 4.2.5-pl, MODX version 2.7.2-advanced, Operating System Apache, MySQL 5.6 version, PHP version 7.3
The text was updated successfully, but these errors were encountered: