J3 Issue ?
avatar coolcat-creations
coolcat-creations
7 Sep 2018

Steps to reproduce the issue

  1. Create a custom field for your articles.
  2. Check that ACL is set to edit own fields only at super user (this is the default) for Editor it's set to disallow
  3. Edit an Article as an Editor (Usergroup)
  4. You can't save the Article because of an Error "Invalid Field"

This field is not set to Required so there is no reason why its invalid...

avatar coolcat-creations coolcat-creations - open - 7 Sep 2018
avatar joomla-cms-bot joomla-cms-bot - change - 7 Sep 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 7 Sep 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 7 Sep 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 7 Sep 2018
Category ACL com_fields
avatar brianteeman brianteeman - change - 7 Sep 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 7 Sep 2018
avatar ReLater
ReLater - comment - 2 Nov 2018
avatar Quy
Quy - comment - 2 Nov 2018

Duplicate #22519?

avatar zero-24
zero-24 - comment - 2 Nov 2018

Please checkout #22923

avatar zero-24 zero-24 - change - 2 Nov 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-11-02 19:58:53
Closed_By zero-24
avatar zero-24 zero-24 - close - 2 Nov 2018
avatar laoneo
laoneo - comment - 5 Nov 2018

Can you test it without this patch #21887. Does it work then as expected?

avatar zero-24
zero-24 - comment - 5 Nov 2018

#21887 has nothing todo with that issue. As this just makes sure that $input is defined and if not does nothing. Please test #22942 by @ggppdk this looks like the correct fix @laoneo

avatar ggppdk
ggppdk - comment - 5 Nov 2018

Actually the error is thrown because of the new code of 21887,
but #21887 by itself is not wrong in its logic

  • because indeed disabled fields are not posted

[EDIT]
code review and tested and the above the behavior of throwing error on disabled but posted fields pre-existed PR #21887, indeed PR #21887 is not related

and throwing error of disabled but posted elements is ok all form elements,
... except for form elements of com_fields array,
that is because fields of com_fields, as you know have the normalization code thing that sets a default of -false- for fields that are not posted (which is later used to make non-posted fields maintain their value)

So normalization code makes disabled fields appear as if they were posted ... which triggers the exception the invalid field exception because field should not exist in the request

avatar ggppdk
ggppdk - comment - 5 Nov 2018

Sorry looking at #21887 more , it seems to me that indeed it is not related,
the behavior i described above , indeed pre-existed PR #21887

i ll test previous code

avatar zero-24
zero-24 - comment - 5 Nov 2018

As described above #21887 adds just a check if input is set do this the original change was from a security change just before that patch applied. But anyway this change seams to be correct. As disabled means no interaction and no data send by the browser. So when you disable a field it is not allowed that this field is in the post data. So read only is the correct way to fix it as this allows to send readonly fields and pass that check.

avatar HLeithner
HLeithner - comment - 7 Mar 2019

This should be fixed now with PR #22923

Add a Comment

Login with GitHub to post a comment