ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Numerous PHP Errors after 2.6 update

April 30, 2013 5:47pm

Subscribe [13]
  • #1 / Apr 30, 2013 5:47pm

    dallasthiele

    6 posts

    After updating to EE 2.6 a number of pages are throwing PHP errors at me. The error is only displayed for me or anyone else with Super Admin level based on the output and debugging settings. But there concerning enough that I’d like to fix whatever the underlying issue is.

    The three errors, which are repeated numerous times depending on the page are as follows:

    A PHP Error was encountered
    Severity: Notice
    Message: Undefined offset: 0
    Filename: relationship_parser/Tree_builder.php
    Line Number: 402

    A PHP Error was encountered
    Severity: Warning
    Message: array_keys() expects parameter 1 to be array, null given
    Filename: relationship_parser/Tree_builder.php
    Line Number: 402

    A PHP Error was encountered
    Severity: Warning
    Message: Invalid argument supplied for foreach()
    Filename: relationship_parser/Tree_builder.php
    Line Number: 413

    Any help on fixing this would be super helpful.

  • #2 / May 03, 2013 1:48pm

    EliVZ

    37 posts

    I’m seeing this too. Has anyone figured out a solution?

  • #3 / May 09, 2013 12:05pm

    amityweb

    162 posts

    Me too! Looks like its the new relationship fieldtype. Looks like it happens when an entry does not have any relationships… in particular I am using {parents id="myrelatedfield"}{/parents}

    If there are no parents, then this line works OK:

    {if parents:no_results}
    Sorry, there are no projects in this programme
    {/if}

    But in addition to this I get the PHP notices too. As soon as add a relationship, notices go away.

  • #4 / May 09, 2013 1:35pm

    EliVZ

    37 posts

    I just upgraded my site to 2.6.1 and confirm that the errors are still present in that version.

  • #5 / May 09, 2013 8:25pm

    Shane Robinson

    55 posts

    Yep! Same problem here!

  • #6 / May 11, 2013 6:55pm

    Richard Dyck

    25 posts

    I’m getting five php errors in any Edit Field page (the Custom Field Type creation page, where you select the fieldtype, enter usage instructions, etc.). If I install the Relationship fieldtype (in addition to the Relationships fieldtype), then I get nine php error messages. Plus the theming of the Edit Field page is wonky. Text too large.

  • #7 / May 11, 2013 7:27pm

    Richard Dyck

    25 posts

    For me, the problem was Denza’s Multi Relationships fieldtype. After I uninstalled it, no more php notices and EE’s relationships fieldtype was usable. Prior to uninstalling Multi Relationships, it was impossible to use EE’s fieldtype; it generated an error and in the error was a mention of Denza’s fieldtype. Luckily, this was a site still in early development, so no data was lost.

    EE’s fieldtype isn’t as good as Denza’s so I need to find a replacement. Any problems with Playa?

  • #8 / Jun 12, 2013 5:07am

    orionlogic

    18 posts

    I have exactly same error after update to EE 2.6.1.

    Any solution?

  • #9 / Jun 12, 2013 1:02pm

    EliVZ

    37 posts

    I eventually “solved” this by changing line 476 in expressionengine/libraries/relationship_parset/Tree_builder.php to this:

    if ($entry_id == NULL || $field_id == 0)

    I have no idea if this is just masking other, deeper problems or if it will have any ill effects, but so far it seems to do the trick.

  • #10 / Jun 18, 2013 4:05pm

    Tony Krol

    21 posts

    Awesome - The above worked for me. No more php errors.

  • #11 / Jul 18, 2013 2:55pm

    Michael Spielman

    42 posts

    Has anyone found a solution to this besides the script rewrite? Also, PHP errors notwithstanding, are the relationship fields otherwise working for you? I’m getting these same errors after upgrading from 1.7.2 to 2.6.1, and the relationship field data is not displaying on the published entry pages.

  • #12 / Jul 18, 2013 5:32pm

    Firebrand Media

    64 posts

    I haven’t found a solution that works - the above solution doesn’t work for me - but I can confirm that the relationship fields are working for me. Granted, my upgrade wasn’t from 1.7 so I’m not sure what the issue could be for you.

    I found that I needed to make some changes to my templates to accommodate the new relationship field type. Specifically, I had some {if} statements that broke with the new relationship field.

  • #13 / Sep 28, 2013 5:51am

    LolaLola

    3 posts

    Same issue here:

    http://ellislab.com/forums/viewthread/238124/

    Think it’s a PHP bug…

  • #14 / Sep 30, 2013 10:23pm

    driverweb

    15 posts

    Definite bug when not adding a “field” parameter to Parents tag and no relationship found.

    You could add a field or rewrite 476 as above and add this to line 402

    if($leaves){
     $field_ids = array_keys($leaves[$depth]);
    }else{     
     $field_ids[0] = 0;
    }

    Not elegant but works.

  • #15 / Apr 01, 2014 9:28am

    Jamie Blacker

    3 posts

    I’ve just had this error again on 2.8.1. Turned out that some entries had been deleted, but their relationship entry was still in the exp_relationships table, so it was looping through looking for non-existent entries. Deleted them from the table and all is well.

    Different version of EE of course, so might be an unrelated issue, but thought I’d post just in case.

    If it helps:

    DELETE FROM exp_relationships WHERE parent_id = XX OR parent_id = XX OR ...
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases