I ran into this in the release version, but found that it persists in the current branch as well. We're using Quick Tabs, and when editing a tabset, it tries to pull a complete list of the available blocks that might be used in a tab. Recently (sometime in the past three weeks), it started throwing the following error:
TypeError: strnatcasecmp(): Argument #1 ($string1) must be of type string, Drupal\system\Entity\Menu given in strnatcasecmp() (line 104 of core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php).
I added a few variable dumps into CategorizingPluginManagerTrait.php to try to figure out what was going on, and found that it was breaking here:
uasort($definitions, function ($a, $b) use ($label_key) {
if ((string) $a['category'] != (string) $b['category']) {
return strnatcasecmp($a['category'], $b['category']);
}
return strnatcasecmp($a[$label_key], $b[$label_key]);
});
When a we_megamenu block hits that second return statement, the value of $label_key is "admin_label" and the contents of $a['admin_label'] is a Drupal\system\Entity\Menu object. Since strnatcasecmp wants strings, it's unhappy.
Now we're still using 8.x-1.13, so I know this isn't the result of some recent change in we_megamenu. I'm thinking perhaps there was a core change recently that triggered this problem? I'm not sure...and maybe this isn't where the problem needs to be fixed. But it seemed like the place to start.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | we_megamenu-tital_incorrectly_defined_1-3357546.patch | 832 bytes | Lingamurthy |
| #2 | we_megamenu-block_label_incorrectly_defined-3357546.patch | 736 bytes | konstantin che |
Issue fork we_megamenu-3357546
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
konstantin che commentedHello! I saw the same problem. And found a solution. I am attaching the patch.
Comment #3
wrd-oaitsd commented#2 solved the problem for me. Thanks!
Comment #4
g089h515r806 commented#2 patch fix the issue.
Comment #8
rjjakes commentedMerged to dev.
Comment #10
Lingamurthy commentedSimplified one