1. On enabling the module, the modules page displays the error message:

warning: Invalid argument supplied for foreach() in /home/752/knowhow/www.knowledge.co.uk/public_html/sites/all/modules/views/views.module on line 80.

After refreshing the modules page, the message disappears.

2. On visiting an existing view, I get another warning message:

warning: Invalid argument supplied for foreach() in /home/752/knowhow/www.knowledge.co.uk/public_html/sites/all/modules/views/includes/admin.inc on line 1060.

Refreshing the Views page, and clearing the Views cache, does not remove the message.

Comments

CobraMP’s picture

I am seeing this as well and
can't choose php as an access option

Chemtox’s picture

Status: Active » Needs review
StatusFileSize
new432 bytes

Just installed the module to try it out, and decided to have a quick go at the warnings. It was easy to spot after a bit of debugging in views.module: there's an alien 'info' item in views_php_views_plugins() (the dangers of copy-paste! ;). Removing it fixed the warnings.

To trigger the first warning, clear the Theme registry cache; for the second, reload an Edit view page.

Ok, now to finally try the module!

giorgosk’s picture

Status: Needs review » Reviewed & tested by the community

warnings are gone with patch

giorgosk’s picture

Status: Reviewed & tested by the community » Needs work

even though it clears the warning
it seems that you are throwing away perfectly good code
marked as needs work

Chemtox’s picture

It is perfectly good code... in hook_views_handlers(), from where it was probably copy-pasted by mistake. If you care to look at the docs (/help/views/api-plugins), you'll see that there's no "info" plugin type, and that even if there where one, a "path" identifier plus the module directory it's still not a proper plugin definition. But I'll let someone else confirm that.

giorgio79’s picture

Looks good to me, thanks Chemtox for the patch and also GiorgiosK for being the first reviewer

iantresman’s picture

Status: Needs work » Reviewed & tested by the community

My thanks too, 24-hours from problem to resolution ain't bad!

Chemtox’s picture

Title: Views PHP: Invalid argument message » Views PHP causing warning: Invalid argument supplied for foreach()
Category: support » bug

If only more problems could be solved with just backspace! ;)

infojunkie’s picture

Status: Reviewed & tested by the community » Fixed

Committed to latest dev. Thanks everyone!

Status: Fixed » Closed (fixed)

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