?
Referenced as Pull Request for: # 9403
avatar sapphireweb
sapphireweb
11 Mar 2016

------------ Requested Change -----------

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)))

------------ Reason -----------

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.

------------ Explanation / Hunch -----------

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.

avatar sapphireweb sapphireweb - open - 11 Mar 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 12 Mar 2016

@sapphireweb can you do a PR for this?

avatar sapphireweb
sapphireweb - comment - 12 Mar 2016

A PR?

avatar andrepereiradasilva
andrepereiradasilva - comment - 12 Mar 2016
avatar sapphireweb
sapphireweb - comment - 12 Mar 2016

Oh... Ok... I thought this was the correct place to post this...

avatar sapphireweb
sapphireweb - comment - 12 Mar 2016

Pull Request done. :) (The problem with having worked with PC's since 1987 is that I know so many acronyms that it gets confusing.)

avatar andrepereiradasilva
andrepereiradasilva - comment - 12 Mar 2016

(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 ;)

avatar andrepereiradasilva
andrepereiradasilva - comment - 12 Mar 2016

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

avatar andrepereiradasilva
andrepereiradasilva - comment - 13 Mar 2016

@brianteeman close as we have a PR (#9403)?

@sapphireweb thanks for the PR

avatar brianteeman
brianteeman - comment - 13 Mar 2016

Closed please test #9403


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

avatar brianteeman brianteeman - change - 13 Mar 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-03-13 12:20:27
Closed_By brianteeman
avatar brianteeman brianteeman - close - 13 Mar 2016

Add a Comment

Login with GitHub to post a comment