I am suggesting a very minor change to the /libraries/cms/application/cms.php file. On line 230,
if (!strlen($msg))
changes to
if (!strlen(trim($msg)))
I had been having an issue on my site with tons of empty system-message-component in pages each with a hidden UL of 40 or more items, all blank, causing empty messages. After some digging, I found the problem. In a debug_backtrace, under com_blankcomponent, in the _messageQueue[] I was finding up to 50 of the following:
Array(
[message] =>
[type] => message )
In examining the the code for com_blankcomponent, I could not find anything that was adding anything to the messageque. After changing the if statement in cms.php, the problem was resolved.
Checking to see if !strlen($msg)) is normally sufficient to avoid adding blank messages. However if a component has a blank message, where the length is greater than 0, but is only whitespace it will still be added to the que. By adding trm(), we strip out all the erogenous spaces and other whitespace characters before checking the length of the message.
A PR?
PR = Pull Request
See https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests
Oh... Ok... I thought this was the correct place to post this...
Pull Request done. :) (The problem with having worked with PC's since 1987 is that I know so many acronyms that it gets confusing.)
(The problem with having worked with PC's since 1987 is that I know so many acronyms that it gets confusing.)
yeah i understand you ;)
actually you have not done the PR yet, you have just made a branch in your fork joomla-cms repository.
See https://github.com/sapphireweb/joomla-cms/tree/patch-1
Now you have to PR to joomla-cms main repository, staging branch.
When you complete the PR it will appear in this list
https://github.com/joomla/joomla-cms/pulls
@brianteeman close as we have a PR (#9403)?
@sapphireweb thanks for the PR
Closed please test #9403
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-03-13 12:20:27 |
Closed_By | ⇒ | brianteeman |
@sapphireweb can you do a PR for this?