I found this critical bug. I have a Drupal 5 web site, and the latest stable DRUPAL-5 release of views.module works fine, but the one in HEAD is broken.
When creating a new view, or editing one, we get this error 3-4 times:
Invalid argument supplied for foreach() in includes/form.inc on line 928.
and the fields, filters, and sort criteria form elements are not properly displayed.

It took me a while to figure out the origin of the bug. The problem is that the form is somehow cached, so to see the error appear, you have to EMPTY {cache}.

Comments

beginner’s picture

... and to see the error disappear, restore the stable version of views.module, EMPTY {cache} and reload the page where you previously had the error.

To switch back and forth between versions, I have cvs checkout'ed both versions of the module into separate directories, views-head and views-stable-5.
In my installation's module/ folder, I then create a symlink called 'views' first to the first folder, then to the second.

merlinofchaos’s picture

Priority: Critical » Normal

It is probably not the form itself that is being cached, but the Views' data.

Either way, the only solution is...when you update, be sure to empty your cache. I'll add something to the release notes for the next release about that.

beginner’s picture

You don't understand.

This is not the views data that is corrupted, since I have the same problem when creating a new views (i.e. there is no data to start with).

The scenario is this:
1) I use happily the last stable release of views.
2) I upgrade views to the latest HEAD (i.e. I change the symlink to point to the right folder).
3) I go to ?q=admin/build/views/add : everything seems normal.
4) I EMPTY {cache}
5) I go back to ?q=admin/build/views/add and I get the error.

In my books, this is critical, since HEAD is unusable!.

beginner’s picture

The reverse procedure is true.

1) I use head with the problems noted above, never mind how many times I clear the cache.
2) I switch back to the stable release of views.
3) I go to ?q=admin/build/views/add : the error remains.
4) I EMPTY {cache}
5) I go back to ?q=admin/build/views/add and everything is back to normal and I can use views again!

merlinofchaos’s picture

Try CVS updating. I committed a patch that sounds like it may've caused this, and later reverted.

beginner’s picture

Priority: Normal » Critical
Status: Active » Fixed

Yes, I just figured that out, by reading the other issues. (http://drupal.org/node/105620)
Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)