I created a 3 level hierarchy in my metatag setup and I saw the third level labels always began with "Unknown: Unknown: level label".

Debuggiing I found the bug
when looking for the label for "a:b:c" it removes c and then ask for parents finding
"a:b" and "a", then it runs an implode and looks for a label for "a:b:a" that is wrong.

Also, if you define a 4th level then this lookup results in an infinite loop and an outofmemory error and you have to manually remove the "4 level" instance definition from the DB in order to be able to use the site again.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bago’s picture

Status: Active » Needs review
FileSize
586 bytes

Here is my patch.

bago’s picture

Priority: Normal » Major

While I fixed this issue for the "unknown" part I move this to major because this fixes also the infinite loop => out of memory => broken site issue when using 4 level instances (declared by custom/third party modules).

Dave Reid’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
FileSize
2.43 KB

Here's an alternate version with some tests to confirm the fix.

Status: Needs review » Needs work

The last submitted patch, 1891082-fix-config-label-recursion.patch, failed testing.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
2.43 KB
Dave Reid’s picture

Another small change, only listing the relevant part in 'Unknown' since we also show the existing lineage.

Dave Reid’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

saitanay’s picture

#6 works fine