Joomla and Zend Server 5.6 SP2 bug

383 views
Skip to first unread message

Viktor Iwan

unread,
Jul 28, 2012, 10:13:28 AM7/28/12
to joomla-de...@googlegroups.com
Hello,
i just patch my server to latest version of Zend Server, but now everytime i add new module (even on fresh clean install), the pop up return:

500 - An error has occurred.

Serialization of 'SimpleXMLElement' is not allowed

Also the old error of "Warning: usort() [function.usort]: Array was modified by the user comparison function in D:\zend\Apache2\htdocs\xxxxxxx\libraries\joomla\utilities\arrayhelper.php on line 463"
is still exist

hope someone here can share a light on me... any zend server user here ?




Sam Moffatt

unread,
Jul 28, 2012, 1:27:54 PM7/28/12
to joomla-de...@googlegroups.com
What version of PHP is it running?

Cheers,

Sam Moffatt
http://pasamio.id.au
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/joomla-dev-general/-/PDANHd5-B4kJ.
> To post to this group, send an email to joomla-de...@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-gene...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-general?hl=en-GB.

Viktor Iwan

unread,
Jul 29, 2012, 12:09:21 AM7/29/12
to joomla-de...@googlegroups.com
Zend Server 5.6 SP2 is based on php 5.3.14

i trace the error and find the problem arise on /components/com_moudles/models/select.php line 145:
$items = JArrayHelper::sortObjects($items, 'name', 1, true, $lang->getLocale());

so the problem caused by the 'famous' usort bug:

What makes this funny and challanging is that usort() is never been a problem in version 2.5.3 and previous. It all start happen in 2.5.4 and above...
i compare source code of arrayhelper.php in 2.5.3 and 2.5.6 and there's no such difference..

i'm hoping someone can dig deeper as this is beyond my expertise.. the problem already reported here, but no one seems care about it
https://github.com/joomla/joomla-cms/issues/179

other thread issue i found:
http://stackoverflow.com/questions/3235387/usort-array-was-modified-by-the-user-comparison-function
https://bugs.php.net/bug.php?id=50688

what makes me curious is there's no problem in 2.5.3 and previous version, i assume joomla use different approach to use JArrayHelper::sortObjects() in 2.5.4 and above




On Sunday, July 29, 2012 12:27:54 AM UTC+7, Samuel Moffatt wrote:
What version of PHP is it running?

Cheers,

Sam Moffatt
http://pasamio.id.au


On Sat, Jul 28, 2012 at 7:13 AM, Viktor Iwan <vic...@doxadigital.com> wrote:
> Hello,
> i just patch my server to latest version of Zend Server, but now everytime i
> add new module (even on fresh clean install), the pop up return:
>
> 500 - An error has occurred.
>
> Serialization of 'SimpleXMLElement' is not allowed
>
> Also the old error of "Warning: usort() [function.usort]: Array was modified
> by the user comparison function in
> D:\zend\Apache2\htdocs\xxxxxxx\libraries\joomla\utilities\arrayhelper.php on
> line 463"
> is still exist
>
> hope someone here can share a light on me... any zend server user here ?
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/joomla-dev-general/-/PDANHd5-B4kJ.
> To post to this group, send an email to joomla-dev-general@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-general+unsub...@googlegroups.com.

elin

unread,
Jul 29, 2012, 8:04:54 AM7/29/12
to joomla-de...@googlegroups.com
Since it seems to be an issue when there is an exception it makes me wonder if something was changed to an exception and that's where it is coming from. The solution in the comments of the php manual of turning off warnings before using usort seems like a not great but workable solution.

Elin

elin

unread,
Jul 29, 2012, 8:28:11 AM7/29/12
to joomla-de...@googlegroups.com
Can you try changing line 463 to:
$errorReporting = error_reporting();
error_reporting(0);
usort($a, array(__CLASS__, '_sortObjects'));
error_reporting($errorReporting);
and see if that "solves" it?

Elin

Viktor Iwan

unread,
Jul 30, 2012, 3:16:13 PM7/30/12
to joomla-de...@googlegroups.com
Now, my temporary solution is to ignore the warning with '@' :
@usort($a, array(__CLASS__, '_sortObjects'));

This bug slow down my joomla... in Extension Manager > Manage ... the query to list all component, module, and plugin is more than 60 seconds in local computer.. :(
it highly related to usort's bug...

elin

unread,
Jul 30, 2012, 5:34:52 PM7/30/12
to joomla-de...@googlegroups.com
@ is not going to solve the problem just turn off the warning, not a good idea. And yes I am wondering if that is why we get some of the slow load reports we do, it could be because of an  exception thrown far away. Please try what i suggested and let us know what happens.  

Elin

Viktor Iwan

unread,
Jul 31, 2012, 11:53:59 AM7/31/12
to joomla-de...@googlegroups.com
Hi Elin, thanks to put your attention in it...
no its not solve the problem.. i'll put some video for this...

Viktor Iwan

unread,
Jul 31, 2012, 12:40:49 PM7/31/12
to joomla-de...@googlegroups.com
i put the demo here:
http://youtu.be/__IDvhTHWXQ

and also i reply your feedback on github.

Hope several core joomla team can aware of this problem, coz i've been (and i believe some developer as well) 'living' with this bug since march. Have to be patience when joomla becomes slow...

Thanks

rsearle

unread,
Aug 30, 2013, 2:02:58 AM8/30/13
to joomla-de...@googlegroups.com
Typecasting fixes it.

Modify /components/com_modules/models/select.php line 145 from:


$items = JArrayHelper::sortObjects($items, 'name', 1, true, $lang->getLocale());

... to ...

$items = JArrayHelper::sortObjects($items, 'name', 1, true, (string) $lang->getLocale());

Cheers,

Russell Searle
Psicom





Reply all
Reply to author
Forward
0 new messages