1

After updaiting to EE 2.9.3 some my sites get many-many errors like this:

A PHP Error was encountered
Severity: Notice
Message: Uninitialized string offset: 19096
Filename: relationship_parser/VariableFinder.php
Line Number: 109

Some googling revealed that probably Grid filetype and obviously relationships are involved.

Do i need change something in templates, is some syntax changed?

Everything on web page works as it should.

1
  • This is why you never jump on the "update right away" band wagon... probably a bug. If the site is functioning as expected, just make sure Debug is set to off (0 in the config) so no visitors see the notices.
    – jrothafer
    Apr 13, 2015 at 15:32

1 Answer 1

0

I think it's a bug. I've seen it on another project I wasn't working on and one just now that I am.

I think the problem stems from a Grid-within-a-relationship or vice-versa. I fixed the first way by splitting the tag into an embed (and passing entry_ids into it), but on my project I had to update the core files, which I hate.

If you ever HAVE TO update core code, I always recommend commenting with a universal token "MYCOMPANYNAME_DEV" so they can be searched for before an upgrade, along with your initials, date, and a description of what you've done (and wherever possible, keep the old code commented out).

I updated the lineToCharacterOffsets method in the VariableFinder.php file, found in /system/expressionengine/libraries/relationship_parser

The line before:

if ($str[$offset] == "\n") {

put this:

if ($offset > strlen($str)) {
    $offset = strlen($str);
    break;
}

It's looking for a linebreak beyond the scope of the string (a string being just an array of char), so I just give it the end of the string and tell it to move on. It seems to do the trick, but hopefully this will be picked up and remedied soon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.