Joomla-cms: `Warning: str_repeat()` after update from 3.7.2 to 3.7.3

Created on 5 Jul 2017  路  7Comments  路  Source: joomla/joomla-cms

Problem in module manager search tools

Warning: str_repeat(): Second argument has to be greater than or equal to 0 in libraries/cms/form/field/menuitem.php on line 234

http://prntscr.com/frsfor

-Thanks

No Code Attached Yet

Most helpful comment

Example code from @alikon should hide the warning but it probably does not fix a reason of your issue.

Do you see an unexpected menu item name like "ROOT" in select box below PHP warning?

If you have access to phpmyadmin you can show us rows from #__menu with column level <= 0.

All 7 comments

As far as I understood this is not an issue, just a simple warning.
Did you check if the message disappears when you change the error report to "None" or "Simple"?

Global configuration > server tab > set error reporting to 'None' or 'Simple'

If it persists, please check the default php settings in your server. Probably they are higher than they should.

For more information, maybe this can help: https://forum.joomla.org/viewtopic.php?t=932244


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

there shouldnt be any warnings

@ittoufiq
can you replace that line libraries/cms/form/field/menuitem.php on line 234
with this one $levelPrefix = str_repeat('- ', max(0, $link->level - 1));
and report back result

IMO This is a sign of corruption of the menu.
Only one menu item "ROOT" can have $link->level less than 1.

Hi, Thanks a lot guys. Should i wait for next Joomla update? Thanks

Example code from @alikon should hide the warning but it probably does not fix a reason of your issue.

Do you see an unexpected menu item name like "ROOT" in select box below PHP warning?

If you have access to phpmyadmin you can show us rows from #__menu with column level <= 0.

I am going to close this due to a lack of reply - it can always be reopened if updated

Was this page helpful?
0 / 5 - 0 ratings