Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I upgrade this module of the current dev version, I get this error
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 352 of /home/includes/entity.inc).
I'm using it for just a menu with this menu link title
<mark>Hi <strong>[site:current-user:first-name]</strong></mark> <em>(go to your account)</em>
Comment | File | Size | Author |
---|---|---|---|
#8 | array_flip_can_only-2444453-8.patch | 571 bytes | joelpittet |
Comments
Comment #1
joelpittetAlso had this issue. Here's a patch that helped me.
Comment #2
joelpittetWell that didn't actually help... that hid the menu items... sorry
Comment #3
knalstaaf CreditAttribution: knalstaaf commentedHaving the same error.
Not sure if this is helpful: https://www.drupal.org/node/1102570#comment-6756382
Comment #4
knalstaaf CreditAttribution: knalstaaf commentedDoes this patch work for you guys?
(It seems to work for me)
Comment #5
knalstaaf CreditAttribution: knalstaaf commentedForget it, it destroys the register page. I confess I was taking a long shot here.
It must be something with line 39 of menu_token_entity_context.inc (
return entity_load_single($entity_type, arg($position));
).@joelpittet: I'm trying your patch and it seems to do ok. What's your concern exactly (should I be worried)? :)
Comment #6
DevElCuy CreditAttribution: DevElCuy at Dilygent commentedPatch at #1 needs to be tested by more people experiencing the same issue.
Also, we don't know how to reproduce this bug. If you know how to, please post a comment with instructions.
Comment #7
johannez CreditAttribution: johannez as a volunteer commentedJoel's patch in #1 actually worked in my case.
I use user tokens in the secondary menu to display the user name. It all works well as long as long as menu context can get you the current user. It doesn't work though for the path /user. Checking if arg($position) actually has a value makes a lot of sense.
Joel, there is a typo in your patch. it should be
if (empty($entity_id)) {...
Comment #8
joelpittetThanks @johannez
Comment #9
apmsooner CreditAttribution: apmsooner commentedTested patch in #8 and works just fine on my end. Thanks!
Comment #11
DevElCuy CreditAttribution: DevElCuy at Dilygent commentedPatch committed! Thank you!
Please help testing and report feedback before this issue gets closed automatically in two weeks.
Comment #13
cozzamara CreditAttribution: cozzamara commentedDev version seam to work for me. No warning appear now in log.
Comment #14
PhilYPatch #8 has been used with success using menu_token 7.x-1.0-beta7 and Drupal 7.63
Although using a different patch code, Dev version 7.x-1.0-beta7+18-dev (updated 22 Mar 2017 at 16:33 CET) seems OK too.
Thanks