Field is altered in the frontend and the backend
field is only altered in the backend
J3.8.1, fresh install, mariadb, PHP7.1-FPM, and I had a hamburger for dinner last night...it was delicious.
I have executed print_r($form->getFieldXML($field,'com_fields')['class']); before and after I made the change and the xml reflects the change - but the output doesn't. I've tried several types of changes, just to be sure I see what I think I'm seeing and the result is always the same - it works in the backend but not the frontend.
One interesting bit - when I $form->removeField('fieldname','com_fields') - the field doesn't disappear -
it moves to the bottom of the fieldgroup. I thought that was very odd.
Labels |
Added:
?
|
Category | ⇒ | com_fields |
This is fun - it occurred to me to trigger a log when the FieldsHelper::prepareForm method was executed. Adding error_log('prepareForm'.microtime());
to the method gave this result in the frontend:
PHP message: prepareForm0.75458500 1509635643
PHP message: prepareForm0.77258000 1509635643
The FormHelper::prepareForm method is being executed twice.
I get this log in the backend:
PHP message: prepareForm0.28052000 1509636249
Something in the frontend is causing FieldsHelper::prepareForm to execute twice.
debug_backtrace shows that in the frontend it's being executed in:
(
[file] => /var/www/html/jcb/libraries/joomla/event/event.php
[line] => 70
[function] => onContentPrepareForm
[class] => PlgSystemFields
[type] => ->
)```
and in
```Array
(
[file] => /var/www/html/jcb/components/com_users/views/profile/view.html.php
[line] => 50
[function] => getForm
[class] => UsersModelProfile
[type] => ->
)```
But in the backend, it's only being executed in:
```Array
(
[file] => /var/www/html/jcb/libraries/joomla/event/event.php
[line] => 70
[function] => onContentPrepareForm
[class] => PlgSystemFields
[type] => ->
)```
I'll keep an eye on that issue while I continue to investigate mine. If I determine that to be the fix, I'll close this issue.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-11-02 19:00:40 |
Closed_By | ⇒ | stutteringp0et |