Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Deleting a custom layout in a site's theme layout directory, even if the layout is not in use by any panel, produces the following error:-
Fatal error: require_once(): Failed opening required '/sites/all/themes/bootstrap_xxx/layouts/example/example.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /sites/all/modules/ctools/includes/plugins.inc on line 475
This means keeping the layouts even if they're not is use. How can a layout be removed?
Comments
Comment #1
hfarrier CreditAttribution: hfarrier commentedSame here - using latest Panopoly distro 1.20. Steps to reproduce.
I also tried to remove plugins[panels][layouts] = layouts from theme .info file without luck. Fatal error persists. The only way to pull site back up again is to transfer the layout files back to the server.
How do you properly delete custom panels layouts?
Comment #2
aleksijohansson CreditAttribution: aleksijohansson commentedWondering the same thing here! Tried clearing caches and even searching the database for references, but didn't find any.
Comment #3
goldin CreditAttribution: goldin commentedYes, you should be able to delete or even rename custom Panels layouts. It appears updating to CTools 7.x-1.6 causes the error.
I recently created/edited/renamed several custom layouts on a site (let's call Site A) with no problem. I copied one of those layouts to Site B and ran into above error when I then tried to edit the layout name.
Site A is running Panels 7.x-3.3 and CTools 7.x-1.4. Site B is running Panels 7.x-3.5 and CTools 7.x-1.6.
I tested locally by updating Site A to CTools 7.x-1.5 and then 7.x-1.6. On each pass I deleted a custom layout. The site threw the error with 7.x-1.6. I also reverted Site B to Panels 7.x-3.4 and CTools 7.x-1.5 and the error disappeared when I deleted or renamed a layout.
Comment #4
jenlamptonThis looks like it is the same problem as #2207147: Fatal error: require_once() panel_context.inc
Comment #5
jenlampton#1032054: Fatal error: require_once() [function.require]: Failed opening required includes/export-ui.inc in includes/plugins.inc on line
Comment #6
pvasili CreditAttribution: pvasili commented1) Try start SQL:
delete from cache where cid like 'ctools_plugin%';
2) Delete unnecessary styles and layouts folder.
3) F5
All unnecessary styles and layouts deleted
Comment #7
Rick Hood CreditAttribution: Rick Hood commentedJust ran into this also. Thanks @pvasili - #6 worked for me.
Comment #8
Dubs CreditAttribution: Dubs commentedThanks @pvasili #6 - works for me too :-)
Comment #9
goldin CreditAttribution: goldin commentedYep, #6 works for me too. It appears you have to execute the command every time you make new changes to your custom layouts.
Thank you @pvasili.
Comment #10
jennypanighetti CreditAttribution: jennypanighetti commentedI removed my layout and had the same error. This sequence of commands helped me:
[edit] Never mind, don't do that... I then couldn't access my site, even on local, it just said "waiting for site.local....." for forever..... I had to download a backup (which didn't have my theme in it) to restore the site.
So, if anybody has any better ideas....? :-/
Comment #11
sch2 CreditAttribution: sch2 commented#6 worked nicely, although it's a really hacky solution for something that should be prevented by the module itself.
Comment #12
museumboy CreditAttribution: museumboy commentedThis was my fix.
1. Replace layout folders as needed to get the site working and flush the cache.
2. Comment out the layout call in your theme .info file like this: ;plugins[panels][layouts] = layouts
3. Return to site and flush cache. Anything in a layout should be missing after flush.
4. Delete offending layout folders
5. Flush cache, you should still see no errors or warnings.
6. Uncomment layout call in .info file
7. Flush cache again.
Site should be good after that. Maybe I didn't need flush cache in step 5, but I like to check my work along the way. This worked for me.
Comment #13
codemonkie CreditAttribution: codemonkie as a volunteer commentedSo, if you delete layout files:
- first do a cache clear
- then delete the files
And you will be fine. You get the error when you delete ctools plugin (layout) files that are still referenced in the ctools cache.
Comment #14
gcarlosvp CreditAttribution: gcarlosvp as a volunteer commented#13 worked for me. Thanks!
Comment #15
MikaT CreditAttribution: MikaT at Siili Solutions commented#6 fixed the issue for me
error was
PHP Fatal error: require_once(): Failed opening required '/srv/project/drupal/docroot/sites/all/modules/contrib/panels/plugins/layouts/xxx.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /srv/project/drupal/docroot/sites/all/modules/contrib/ctools/includes/plugins.inc on line 477
Comment #16
Marvine CreditAttribution: Marvine commentedKeep in mind that if your are using memcache to store the content of the cache table you would have to restart the memcache service by doing something like
sudo service memcached restart
Comment #17
webdrips CreditAttribution: webdrips commentedThis worked for me:
Comment #18
ugintl CreditAttribution: ugintl commented#6 worked for me
Comment #19
Gonzalo2683 CreditAttribution: Gonzalo2683 commentedThe #12 works for me. Thanks @museumboy