?
avatar svenboulanger
svenboulanger
19 Jan 2018

Steps to reproduce the issue

Create a custom user field for articles. Set the custom field value for any article, then try and edit the article in the frontend as administrator or any user that can edit the user field value.

Expected result

The user field value should not be changed since it is not visible anyway in the frontend.

Actual result

The user field value is cleared.

System information (as much as possible)

Joomla! Version: Joomla! 3.8.3 Stable [ Amani ] 12-December-2017 15:00 GMT
Joomla! Platform Version: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
PHP version: 7.0.10

Additional comments

I tracked the problem to plugins\system\fields\fields.php on line 91.

// Determine the value if it is available from the data
$value = key_exists($field->name, $fieldsData) ? $fieldsData[$field->name] : null;

// Setting the value for the field and the item
$model->setFieldValue($field->id, $item->id, $value);

If the field is not found in the data, I guess it should be ignored rather than passed null?

avatar svenboulanger svenboulanger - open - 19 Jan 2018
avatar joomla-cms-bot joomla-cms-bot - change - 19 Jan 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 Jan 2018
avatar joomdonation
joomdonation - comment - 19 Jan 2018

Please check this PR #18207, it might solve that issue

avatar joomla-cms-bot joomla-cms-bot - edited - 19 Jan 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Jan 2018
Title
Custom fields cleared in frontend
[com_fields] cleared in frontend
Status New Information Required
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Jan 2018
Category com_fields
avatar svenboulanger
svenboulanger - comment - 19 Jan 2018

I believe that pull request will solve the issue.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Jan 2018

@svenboulanger can you please close this Issue if the PR solve the Issue?

avatar svenboulanger svenboulanger - change - 19 Jan 2018
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2018-01-19 14:16:54
Closed_By svenboulanger
avatar svenboulanger svenboulanger - close - 19 Jan 2018

Add a Comment

Login with GitHub to post a comment