Hi,
I’m receiving tons of errors such as this:
A PHP Error was encountered
Severity: Warning
Message: Wrong parameter count for array_unique()
Filename: relationship_parser/Tree_builder.php
Line Number: 135
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 329
Filename: relationship_parser/Parser.php
Line Number: 52
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 337
Filename: relationship_parser/Parser.php
Line Number: 52I’m running EE 2.7
PHP Version 5.2.6-1+lenny16
My template looks like this:
{exp:channel:entries channel="independent_faq_page"}
{parents sort="desc" orderby="title" }
<h4><a href="#">{parents:title}</a></h4>
<p> <div class="accordionpanel"><br />
{parents:faq_answer}<br />
</div><br />
{/parents} <br />
<br />
{/exp:channel:entries}Strangely, this works fine on my local environment. I have the exact same files, the exact same database, but the difference is I’m running Mamp with PHP Version 5.2.17. I have tried changing the PHP version to 5.3.14 and 5.4.4 and things work ok there too.
I can only imagine there is some bug with php version 5.2.6?
I have edited the file expressionengine/libraries/relationship_parser/Tree_Builder.php below line 497 to echo out the entry ids like so:
$field_id = $leaf['L'.$i.'_field'];
$entry_id = (int) $leaf['L'.$i.'_id'];
$parent_id = (int) $leaf['L'.$i.'_parent'];
echo $entry_id; // <!-- Echo out entry idsI then visit the same page on both staging/local.
On my staging environment the result is:
329,337,330,338,331,339,332,340,333,341,334,342,327,335,328,336,
On my local environment the result is:
327,335,328,336,329,337,330,338,331,339,332,340,333,341,334,342,
So clearly there is some disparity between the entry ids being returned on staging vs local, hence the offset errors.
I have been doing some research and someone else has found a bug with array_unique() on one version of PHP, and there was a fix. But that doesn’t work for my version it seems. Here is that solution:
http://ellislab.com/forums/viewthread/236495/#1058926
Any ideas please??