Skip to content

Commit

Permalink
make sure disabled fields are not added to the request at all
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Nov 2, 2018
1 parent f4b56f1 commit 7abc845
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/system/fields/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ public function onContentNormaliseRequestData($context, $data, Form $form)
// Loop over all fields
foreach ($form->getGroup('com_fields') as $field)
{
if ($field->disabled === true)
{
/**
* Disabled fields should NEVER be added to the request as
* they should NEVER be added by the browser anyway so nothing to check against
* as "disabled" means no interaction at all.
*/
continue;
}

// Make sure the data object has an entry
if (isset($data->com_fields[$field->fieldname]))
{
Expand Down

1 comment on commit 7abc845

@zigydk
Copy link

@zigydk zigydk commented on 7abc845 Nov 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have implemented this change on 3.9.0 and I confirm that it fixes my problem of not being able to save profile change in FE if the profile had any custom fields added, and those had default settings of Disallow on permissions. (Read-only fields)

Please sign in to comment.