User tests: Successful: Unsuccessful:
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.
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;
In the output should the value and rawvalue fields be filled.
In the output are the value and rawvalue fields are empty.
Category | ⇒ | Administration com_fields |
Status | New | ⇒ | Pending |
I have tested this item
Modified article.php
, got:
File looks like:
Can you try it on a fresh installation?
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] =>
)
)
Strange, can you try it with the updated test instructions? Basically you need to add $article->text = '';
after $article = $this->getItem();
.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
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:
?
|
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.