No Code Attached Yet
avatar ZhukDmitry
ZhukDmitry
23 Nov 2022

Steps to reproduce the issue

Hi
I don't know bug it or feature request

Open any detail item for edit, ie from list to detail view form. In form definition one item is set readonly

Update your database record, set your item to some value

Save your form

Expected result

Your readonly item should not be updated

Actual result

Your readonly item is updated to your value in form

System information (as much as possible)

Joomla 3.10.11
I developing my extension, and noticed, that all fields in form definition (XML), are used in Update DML clause.
I didn't analyze Joomla code for it, but it is easy to reproduce

Additional comments

I expected that read only fields in form are not used in Update SQL clause.

Probably there is some attribute to do that.
It is useful (in my opinion), and it will be good to have it in J3 and J4

avatar ZhukDmitry ZhukDmitry - open - 23 Nov 2022
avatar ZhukDmitry ZhukDmitry - change - 23 Nov 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 23 Nov 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Nov 2022
avatar ZhukDmitry ZhukDmitry - change - 23 Nov 2022
The description was changed
avatar ZhukDmitry ZhukDmitry - edited - 23 Nov 2022
avatar ZhukDmitry ZhukDmitry - edited - 23 Nov 2022
avatar joomdonation joomdonation - change - 24 Nov 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-11-24 03:01:21
Closed_By joomdonation
avatar joomdonation joomdonation - close - 24 Nov 2022
avatar joomdonation
joomdonation - comment - 24 Nov 2022

readonly is only used in the UI to prevent users to change the value of that field on the form. The data for that field will still being submitted to server, so it changes the data of that field in database table

For your need, you also need to add filter="unset" to your field definition and it will work as expected. Closing as this is not a valid issue.

Add a Comment

Login with GitHub to post a comment