User tests: Successful: Unsuccessful:
When the languagecode plugin is enabled, you get a PHP notice about $data->name
each time you save another plugin. This is because $data
is null
during the save process when it comes to the onContentPrepareForm
event. Thus the check fails.
Also empty($data)
always returns true because $data
is converted to an object (empty() returns always true for objects)
I've added a new hidden parameter languagecodeplugin
to the plugin manifest.
During the onContentPrepareForm
event, I now only check for the presence of this field in the form and only process further if the field is present.
This makes the checks simpler and removes the PHP notice
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33001
Description | <h3>Issue</h3> <p>When the languagecode plugin is enabled, you get a PHP notice about <code>$data->name</code> each time you save another plugin. This is because <code>$data</code> is <code>null</code> during the save process when it comes to the <code>onContentPrepareForm</code> event. Thus the check fails.<br> Also <code>empty($data)</code> always returns true because <code>$data</code> is converted to an object (empty() returns always true for objects)</p> <h3>Proposed Solution</h3> <p>I've added a new hidden parameter <code>languagecodeplugin</code> to the plugin manifest.<br> During the <code>onContentPrepareForm</code> event, I now only check for the presence of this field in the form and only process further if the field is present.<br> This makes the checks simpler and removes the PHP notice</p> <h3>Test Instructions</h3> <ul> <li>Enable the languagecode plugin and make sure you can edit and save the language codes.</li> <li>Edit and save any other plugin</li> <li>Check PHP error logs to make sure no notices are generated anymore.</li> </ul> | ⇒ | <h3>Issue</h3> <p>When the languagecode plugin is enabled, you get a PHP notice about <code>$data->name</code> each time you save another plugin. This is because <code>$data</code> is <code>null</code> during the save process when it comes to the <code>onContentPrepareForm</code> event. Thus the check fails.<br> Also <code>empty($data)</code> always returns true because <code>$data</code> is converted to an object (empty() returns always true for objects)</p> <h3>Proposed Solution</h3> <p>I've added a new hidden parameter <code>languagecodeplugin</code> to the plugin manifest.<br> During the <code>onContentPrepareForm</code> event, I now only check for the presence of this field in the form and only process further if the field is present.<br> This makes the checks simpler and removes the PHP notice</p> <h3>Test Instructions</h3> <ul> <li>Enable the languagecode plugin and make sure you can edit and save the language codes.</li> <li>Edit and save any other plugin</li> <li>Check PHP error logs to make sure no notices are generated anymore.</li> </ul><h4>Tracker</h4> <p><a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33001">http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33001</a></p> |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2013-12-23 07:33:16 |
Labels |
Added:
?
?
|
@infograf768 Feel free to test