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>

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet’s picture

Status: Active » Needs review
FileSize
562 bytes

Also had this issue. Here's a patch that helped me.

joelpittet’s picture

Status: Needs review » Needs work

Well that didn't actually help... that hid the menu items... sorry

knalstaaf’s picture

Having the same error.

Not sure if this is helpful: https://www.drupal.org/node/1102570#comment-6756382

knalstaaf’s picture

Status: Needs work » Needs review
FileSize
588 bytes

Does this patch work for you guys?

(It seems to work for me)

knalstaaf’s picture

Priority: Normal » Major
Status: Needs review » Needs work

Forget 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)? :)

DevElCuy’s picture

Status: Needs work » Needs review

Patch 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.

johannez’s picture

Joel'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)) {...

joelpittet’s picture

Thanks @johannez

apmsooner’s picture

Status: Needs review » Reviewed & tested by the community

Tested patch in #8 and works just fine on my end. Thanks!

  • develCuy committed d3e93eb on 7.x-1.x authored by joelpittet
    Issue #2444453 by joelpittet, knalstaaf: array_flip(): Can only flip...
DevElCuy’s picture

Status: Reviewed & tested by the community » Fixed

Patch committed! Thank you!

Please help testing and report feedback before this issue gets closed automatically in two weeks.

Status: Fixed » Closed (fixed)

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

cozzamara’s picture

Dev version seam to work for me. No warning appear now in log.

PhilY’s picture

Patch #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