Undefined titles on alert messages #5366
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


This solves an issue with installation showing "undefined" alert messages reported in #5331. Issue was introduced by me in #5257
Description
Basically the installation process is not adding alert message type translations properly (Before using any message type you have to add the JS translation with
JText::script('MESSAGE');,JText::script('ERROR');, etc.). If not the message is not really translated. This is discovered after removing the jQuery dependency in #5257Basically what I'm doing now is testing that the translation of the message type has been defined and if not we skip adding the alert heading. This preserves exactly the previous behavior. Of course it would be better to add that message types translations to the installer but I think this fix makes sense anyway if third part extension developers forget to add the translation for example.
Backward compatibility
This PR has no B/C issues. In fact it fixes one.
Test
On the first Joomla installation screen of Joomla do not fill any fields and press the
Nextbutton. You should see theundefinedalert message titles. After applyting the patch no titles should be visible.