? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
27 Jul 2017

Summary of Changes

For performance reasons, com_fields saves the fields in memory during a request. This cache should be cleared after saving custom fields or custom fields values.

Testing Instructions

Add the following code to the file administrator/components/com_content/models/article.php after line 623 (if (parent::save($data)) {)

$params = \Joomla\CMS\Component\ComponentHelper::getParams('com_content');
$article = $this->getItem();
$article->text = '';
JEventDispatcher::getInstance()->trigger(
	'onContentPrepare',
	[
		'com_content.article',
		&$article,
		&$params,
		0
	]
);
print_r($article->jcfields);die;
  • Create an article custom field
  • Create an article
  • Fill in a value for the custom field
  • Save the article

Expected result

In the output should the value and rawvalue fields be filled.

Actual result

In the output are the value and rawvalue fields are empty.

avatar joomla-cms-bot joomla-cms-bot - change - 27 Jul 2017
Category Administration com_fields
avatar laoneo laoneo - open - 27 Jul 2017
avatar laoneo laoneo - change - 27 Jul 2017
Status New Pending
avatar laoneo laoneo - change - 27 Jul 2017
The description was changed
avatar laoneo laoneo - edited - 27 Jul 2017
avatar pitcock pitcock - test_item - 27 Jul 2017 - Tested successfully
avatar pitcock
pitcock - comment - 27 Jul 2017

I have tested this item successfully on cd69f9f


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17291.

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 31 Jul 2017 - Tested unsuccessfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 31 Jul 2017

I have tested this item ? unsuccessfully on cd69f9f
Modified article.php, got:
bildschirmfoto 2017-07-31 um 14 25 38
bildschirmfoto 2017-07-31 um 14 26 06
File looks like:
bildschirmfoto 2017-07-31 um 14 25 23


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17291.
avatar laoneo
laoneo - comment - 7 Aug 2017

Can you try it on a fresh installation?

avatar Quy
Quy - comment - 7 Aug 2017

Same error.

<b>Notice</b>:  Undefined property: JObject::$text in <b>C:\xampp\htdocs\joomla-cms\plugins\content\loadmodule\loadmodule.php</b> on line <b>45</b><br />
<br />
<b>Notice</b>:  Undefined property: JObject::$text in <b>C:\xampp\htdocs\joomla-cms\plugins\content\loadmodule\loadmodule.php</b> on line <b>45</b><br />
Array
(
    [1] => stdClass Object
        (
            [id] => 1
            [title] => TextField
            [name] => textfield
            [checked_out] => 0
            [checked_out_time] => 0000-00-00 00:00:00
            [note] => 
            [state] => 1
            [access] => 1
            [created_time] => 2017-08-07 16:23:37
            [created_user_id] => 167
            [ordering] => 0
            [language] => *
            [fieldparams] => Joomla\Registry\Registry Object
                (
                    [data:protected] => stdClass Object
                        (
                            [filter] => 
                            [maxlength] => 
                        )

                    [initialized:protected] => 1
                    [separator] => .
                )

            [params] => Joomla\Registry\Registry Object
                (
                    [data:protected] => stdClass Object
                        (
                            [hint] => 
                            [render_class] => 
                            [class] => 
                            [showlabel] => 1
                            [show_on] => 
                            [display] => 2
                        )

                    [initialized:protected] => 1
                    [separator] => .
                )

            [type] => text
            [default_value] => 
            [context] => com_content.article
            [group_id] => 0
            [label] => TextField
            [description] => 
            [required] => 0
            [language_title] => 
            [language_image] => 
            [editor] => 
            [access_level] => Public
            [author_name] => Super User
            [group_title] => 
            [group_access] => 
            [group_state] => 
            [value] => 
            [rawvalue] => 
        )

)
avatar laoneo laoneo - change - 8 Aug 2017
The description was changed
avatar laoneo laoneo - edited - 8 Aug 2017
avatar laoneo
laoneo - comment - 8 Aug 2017

Strange, can you try it with the updated test instructions? Basically you need to add $article->text = ''; after $article = $this->getItem();.

avatar Quy Quy - test_item - 8 Aug 2017 - Tested successfully
avatar Quy
Quy - comment - 8 Aug 2017

I have tested this item successfully on cd69f9f


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17291.

avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Aug 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 8 Aug 2017

RTC after two successful tests.

avatar mbabker mbabker - change - 13 Aug 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-08-13 15:43:01
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 13 Aug 2017
avatar mbabker mbabker - merge - 13 Aug 2017

Add a Comment

Login with GitHub to post a comment