? Success

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
19 Dec 2013

Issue

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)

Proposed Solution

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

Test Instructions

  • Enable the languagecode plugin and make sure you can edit and save the language codes.
  • Edit and save any other plugin
  • Check PHP error logs to make sure no notices are generated anymore.

Tracker

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33001

avatar Bakual Bakual - open - 19 Dec 2013
avatar Bakual
Bakual - comment - 19 Dec 2013

@infograf768 Feel free to test :smile:

avatar Bakual Bakual - change - 23 Dec 2013
The description was changed
Description <h3>Issue</h3> <p>When the languagecode plugin is enabled, you get a PHP notice about <code>$data-&gt;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-&gt;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&amp;tracker_item_id=33001">http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;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: ? ?
avatar Bakual Bakual - close - 23 Dec 2013
avatar Bakual Bakual - close - 23 Dec 2013
avatar Bakual Bakual - head_ref_deleted - 23 Dec 2013

Add a Comment

Login with GitHub to post a comment