pegasus
Well-known member
- Affected version
- 2.3.0 Beta 1
In 2.3.0, the Templater has added the new processEntityAttributes method, which fills an attribute value automatically based on an entity's phrase value. This works great, until we run into an entity that is missing its Master Phrase for some reason, maybe accidental deletion of the phrase.
I ran into this issue when using the AdminCP to attempt to edit a BB-Code that was missing its Master Phrase for the description, figuring I could just edit the field and thus regenerate the appropriate phrase. However, instead of the editor, I received the following error message:
The issue rests in this line:
I was able to temporarily resolve it with the following replacement:
In 2.2.15, this error does not occur when editing an entity that is missing master-phrases.
I ran into this issue when using the AdminCP to attempt to edit a BB-Code that was missing its Master Phrase for the description, figuring I could just edit the field and thus regenerate the appropriate phrase. However, instead of the editor, I received the following error message:
Code:
Template Compilation Error
admin:bb_code_edit - Call to a member function get() on null in /[redacted]/src/XF/Template/Templater.php:6916
Code:
$attributes['value'] = $entity->exists() ? $entity->$masterPhraseRelation->get('phrase_text') : '';
Code:
$attributes['value'] = ($entity->exists() AND $entity->$masterPhraseRelation) ? $entity->$masterPhraseRelation->get('phrase_text') : '';
In 2.2.15, this error does not occur when editing an entity that is missing master-phrases.