I renamed a View (machine name) and the panel WSOD. It was an og_panel.

Comments

catch’s picture

http://drupal.org/node/279642 was duplicate and has some more discussion on this.

catch’s picture

Title: Rename a View leads to WSOD » Renaming a View breaks panels.
Priority: Normal » Critical

http://drupal.org/node/242038 also duplicate. Bumping to critical since this fails ungracefully.

sun’s picture

Confirming and clarifying:

If the internal machine name of a view is renamed, Panels Views panes are not updated accordingly and all panes using the View pane are still trying to render the view using its old name.

IIRC, the manual fix for this is:

UPDATE {panels_views} SET view = 'new_name' WHERE view = 'old_name';
DELETE FROM {panels_object_cache};

However, I guess the real issue is that we do not know when a view is renamed.

sdboyer’s picture

The only fix I can think of for this - as UGLY as it is - is to simply hook_form_alter the views edit form itself, add a hidden form field that contains the current view name, and conditionally add a submit function that will check to see if the name has been changed. If it does, then we go in and change the corresponding values in in views panes.

I'm gonna try out this 'solution,' see how it works.

sdboyer’s picture

Priority: Critical » Normal

Well, one quick note at least - on my sandbox, this isn't causing a WSOD anymore. Just an ugly foreach error on the view pane config form for the view pane that's had its view pulled out from under it, and the panels display simply fails to render the pane. Since it seems to be degrading gracefully now, I'm ratcheting it back to 'normal.' But still gonna try my ugly hacky fix.

sdboyer’s picture

Status: Active » Fixed

Well, it's in - ugly, but it does the trick. I decided to err on the safe side and just update the view field in {panels_views} whenever the base view is edited, rather than playing some fancy footwork to tell if the view name was actually changed. Really no point, and probably more error-proof this way.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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