User tests: Successful: Unsuccessful:
without array-index "success" this message output create a PHP-Notice "undefined index on..."
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-09-15 08:13:07 |
Closed_By | ⇒ | Bakual |
Since Joomla! 3 uses bootstraped templates, the messages will use the standard bootstrap CSS styles for Alerts.
https://docs.joomla.org/Display_error_messages_and_notices#Joomla.21_3.x_is_bootstrapped
If I like a green (success) output for my message, at first I look in Joomla! core output (/layout/joomla/system/message.php). If I use "message" the standard Joomla! output for messagebox is yellow (Notice), I like green. To handle this my code must be "success" a message type for the right output.
Now, if you like to reconfigure this in an override, best practice will be to rewrite the standard at first.
In Bootstrap 2 this will be
If someone else uses an other template, without your override, the only possibility to get a green messagebox is to set my message type basicly to "success"
Finaly, this protostar override couses an PHP-Notice.
I don't say we should not fix the notice, but this PR is the wrong approach. It comes from the fact that the extension uses a "custom" type for the enqueueMessage method.
What you should instead do is check if the key exists in the $alert
array and if not just use the type directly. Something like
<div class="alert <?php echo isset($alert[$type]) ? $alert[$type] : 'alert-' . $type; ?>">
ok, is the better way to fix this notice :-)
There is no "success" message type. See https://docs.joomla.org/Display_error_messages_and_notices
There are
closing as this is an issue of the extension in question and not from core.