0

I'm missing something. I've written a plugin to manipulate specific custom user fields (the new custom fields extension). I create the fields, and make them required, but in /adminstrator I remove the required attribute using:

$form->setFieldAttribute('fieldname','required','','com_fields');

That part works great.

In my plugin, I also identify groups which will be relieved of the requirement in the frontend - but none of those attribute changes seem to stick.

If I print_r the $form variable before and after I make my change - I can see the change is made in the JFormXML object - but the form still displays the field as required. I can add a class attribute and it shows up in the backend - but not the frontend.

I even went so far as to execute $form->removeField('fieldname','com_fields') and to my surprise, the field re-appeared at the bottom of the field group (from first to last)! There seems to be no way to modify these fields in the front-end....unless I'm missing something.

0

In the frontend, FieldsHelper::prepareForm is run twice - a pull request has been issued to resolve this problem.

It should be resolved in 3.8.2 if the pull request is accepted and merged.

https://github.com/joomla/joomla-cms/pull/18211

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.