After updating to the latest version of Drupal core, this is the warning I receive:

Invalid argument supplied for foreach() in amswap_prerender_toolbar_administration_tray() (line 64 of /amswap.module)

Comments

doxigo created an issue. See original summary.

jalpesh’s picture

Status: Active » Needs review
StatusFileSize
new491 bytes

Try this patch.

doxigo’s picture

Thanks, but isn't your patch for minify module and not amswap?

jalpesh’s picture

Sorry Doxigo. I was working on other module and by mistake upload a patch on this issue.

Sorry again. I will remove it.

jalpesh’s picture

Status: Needs review » Active
doxigo’s picture

So apparently I was pointing out to the wrong Role/Menu manchine name, and that was the reason I was getting that error, I changed that and the error is gone, but I think we should still check to see if there's a Role/Menu by that name before saving the configuration

siva01’s picture

I get similar error immediately after installation: Warning: Invalid argument supplied for foreach() in /var/www/html/docroot/modules/contrib/amswap/amswap.module on line 64. We use PHP 7.1.17.

saurabh.dhariwal’s picture

Status: Active » Needs review
StatusFileSize
new1.28 KB

@doxigo, Please Try with my attached solution in which I tried to solve the above mentioned warning. Let me know if you still face any issue.

Hope this helps you.

Thanks!.

maxplus’s picture

Thanks!
patch from #8 solved this issue for me

cobenash’s picture

Status: Needs review » Reviewed & tested by the community

Thanks. #8 works for me.

droces’s picture

Title: Invalid argument supplied for foreach() in amswap_prerender_toolbar_administration_tray() (line 64 of /amswap.module) » When updating, error: Invalid argument supplied

  • droces committed 65dcce2 on 8.x-1.x
    Fixed #2967902 by jalpesh, doxigo, saurabh.dhariwal: When installing or...
droces’s picture

Assigned: Unassigned » droces
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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