After you enable the module and connect the instapage account and go to add a new page, the: Invalid argument supplied for foreach() in Drupal\instapage\Controller\PageSettingsController->content() warning is shown, because there are no pages added yet. I also removed the soon to be deprecated drupal_set_message.

Comments

DeaOm created an issue. See original summary.

deaom’s picture

Status: Active » Needs review
StatusFileSize
new3.69 KB

And the patch that should fix the error.

nace_fr’s picture

StatusFileSize
new5.06 KB

I was able to reproduce this issue and tested the patch from #2. It applied without errors/warnings and solved the problem. I just added DI to the patch. Thanks DeaOm.

deaom’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies and messages are displayed. DI seems to be correctly implemented so marking this as RTBC.

kbrodej’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new5.06 KB
new520 bytes

Hi.
Reviewed the patch from #3.

Replaced if ($pages != NULL) to if (is_array($pages)).

  • benjamincizej committed f8275b3 on 8.x-2.x authored by kbrodej
    Issue #3075776 by kbrodej, DeaOm, nace_fric: Warning: Invalid argument...
bcizej’s picture

Status: Needs review » Fixed
StatusFileSize
new3.03 KB

Patch rerolled and commited. Thanks everyone.

Status: Fixed » Closed (fixed)

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