Hi @all,

I'm currently working on a Drupal site which uses Views. To be able to test and install fast, I wrote my own installation profile for this project so I dont't need to enable all modules every time and don't need to configure everything from scratch.

unfortunately i run into several propblems after such a fresh install now:

One of my installed modules provides a default view via hook_views_default_views(). The view structure itself was exported using the views exporter and the default view is enabled by default. Everything works fine with the default view (displays all values correctly), until I try to edit and save it (unfortunately this is with all default views provided by the views module. Hitting the save button results in the following error messages (the PHP errors occure more than once each):

Invalid argument supplied for foreach() in includes/view.inc on line 1579.
Invalid argument supplied for foreach() in includes/view.inc on line 1646.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY vid, position' at line 1 query: SELECT * FROM my_table_alias_views_display WHERE vid IN () ORDER BY vid, position in includes/view.inc on line 1272

I read a bit in the code and the PHP errors happen in the save_row() and load_row() methods of view (the schema does not seem to be laded properly even though the tables definetely exist), the MySQL error occures in the load_views() method of view.

After this action, I have a broken view in my list of views, which I cannot edit, export, clone or even delete. I need to go to a database administration tool to delete the row from views_view manually... and the strangest thing at all is: when i use devel's "Reinstall module" page to reinstall the views module, everything works fine afterwards.

Does anone have an idea?

Thanx in advance & cheers

hctom

Comments

hctom’s picture

Status: Active » Needs review

I think I found the soultion: I am using an install profile for my site. Unfortunately the schema cache does not seem to be flushed after the pforile completed. So the views module deals with an old schema structure until the cache is cleared.

I will file this as a feature request to Drupal core, so you do not have to implement a clear cache task in each install profile.

Cheers

hctom

hctom’s picture

I created a feature request - see http://drupal.org/node/509266

merlinofchaos’s picture

Priority: Critical » Normal
Status: Needs review » Postponed

needs review means there is a patch, but there isn't one. Marking this postponed on the results of #509266: Clear schema cache after profile modules where installed

dawehner’s picture

Status: Postponed » Closed (duplicate)