You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem
The process of creating a new field from an add-on is documented, including an example code snippet.
When applying this code-snippet from an add-on that is not called from within CP, the field validation step triggers an EE exception error, this effectively prevents add-ons not called from within CP from validating the field before it is saved.
The validation exception is caused by a call to ee()->cp->invalid_custom_field_names() (which exists within the CP model) which simply returns an array of protected strings; there is no apparent reason why this simple method needs to be tied to the CP model (the code comprises 100% regular php).
How To Reproduce
Implement the example code in an addon called from outside the CP.
Description of the problem
The process of creating a new field from an add-on is documented, including an example code snippet.
When applying this code-snippet from an add-on that is not called from within CP, the field validation step triggers an EE exception error, this effectively prevents add-ons not called from within CP from validating the field before it is saved.
The validation exception is caused by a call to
ee()->cp->invalid_custom_field_names()
(which exists within the CP model) which simply returns an array of protected strings; there is no apparent reason why this simple method needs to be tied to the CP model (the code comprises 100% regular php).How To Reproduce
Implement the example code in an addon called from outside the CP.
Error Messages
Environment Details:
Possible Solution
Relocate the
invalid_custom_field_names
method to somewhere that accessible all the time... ?The text was updated successfully, but these errors were encountered: