? Success

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
15 Sep 2015

This PR proposes a better fix than #7884

Issue

If an extension uses a custom message type in the enqueueMessage($message, $type) method, then it will currently show a notice:

Notice: Undefined index: foo in ...\templates\protostar\html\layouts\joomla\system\message.php`

Solution

Check first if the array key is set before calling it. If not set, just use the $type directly.

Testing

Simplest is to just add the following line to the start of the index.php of the template:
JFactory::getApplication()->enqueueMessage('test', 'success'); (should create a green message)
or
JFactory::getApplication()->enqueueMessage('test', 'foo'); (should create a orange message)

Note

The Isis template uses the same JLayout, so I changed it there as well.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar Bakual Bakual - open - 15 Sep 2015
avatar Bakual Bakual - change - 15 Sep 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Sep 2015
Labels Added: ?
avatar degobbis degobbis - test_item - 16 Sep 2015 - Tested successfully
avatar zero-24 zero-24 - change - 17 Sep 2015
Category Layout
avatar zero-24 zero-24 - change - 17 Sep 2015
Status Pending Ready to Commit
Easy No Yes
avatar zero-24
zero-24 - comment - 17 Sep 2015

Tested successful. Together with the test by @degobbis I'm going to mark it RTC. Thanks @Bakual and @degobbis


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

avatar joomla-cms-bot joomla-cms-bot - change - 17 Sep 2015
Labels Added: ?
avatar zero-24 zero-24 - test_item - 17 Sep 2015 - Tested successfully
avatar zero-24 zero-24 - change - 17 Sep 2015
Milestone Added:
avatar zero-24 zero-24 - change - 17 Sep 2015
Milestone Added:
avatar rdeutz rdeutz - reference | aee0a6b - 1 Oct 15
avatar rdeutz rdeutz - merge - 1 Oct 2015
avatar rdeutz rdeutz - close - 1 Oct 2015
avatar rdeutz rdeutz - change - 1 Oct 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-10-01 18:36:24
Closed_By rdeutz
avatar rdeutz rdeutz - close - 1 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - close - 1 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - change - 1 Oct 2015
Labels Removed: ?
avatar Bakual Bakual - head_ref_deleted - 4 Oct 2015
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone

Add a Comment

Login with GitHub to post a comment