You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Largo stores the homepage layout chosen as a string that is the name of the homepage layout class, which implements Homepage. This string is stored in the options framework, and is fetched by a dedicated function:
If that string doesn't correspond to a class in the current scope, the homepage of a site will fail to render.
Fatal error: Uncaught Error: Class 'CityLimits' not found in /Users/blk/sites/citylimits/wp-content/themes/Largo/homepages/homepage.php:79
Stack trace:
#0 /Users/user/sites/example/wp-content/themes/Largo/home.php(35): largo_render_homepage_layout('ExampleHomepage') #1 /Users/user/sites/example/wp-includes/template-loader.php(78): include('/Users/blk/site...') #2 /Users/user/sites/example/wp-blog-header.php(19): require_once('/Users/blk/site...') #3 /Users/user/sites/example/index.php(17): require('/Users/blk/site...') #4 /Users/user/.composer/vendor/laravel/valet/server.php(158): require('/Users/blk/site...') #5 {main} thrown in /Users/user/sites/example/wp-content/themes/Largo/homepages/homepage.php on line 79
We can fix this by:
making sure that all "what is the homepage class" questions use the largo_get_active_homepage_layout function
have largo_get_active_homepage_layout test whether that string is a class that exists
have largo_get_active_homepage_layout return an error or debug log output when the class does not exist
Marking this as priority: low because this has only really been problem when switching back and forth between feature branches of child themes that add or remove homepage layouts, and it only breaks the homepage. Sites experiencing this problem can still get into their theme options and change the layout.
The text was updated successfully, but these errors were encountered:
Largo stores the homepage layout chosen as a string that is the name of the homepage layout class, which implements
Homepage
. This string is stored in the options framework, and is fetched by a dedicated function:https://github.com/INN/largo/blob/512da701664b329f2f92244bbe54880a6e146431/homepages/homepage.php#L83-L88
This layout string is passed to the function that attempts to render the layout:
https://github.com/INN/largo/blob/f50df16e9e06fb9402802e2f1ce76ce058d26d76/home.php#L26-L35
largo_render_homepage_layout has no check to see whether the class exists:
https://github.com/INN/largo/blob/c41d8519370b48a6e53ce36b3b516d3e54e39d66/homepages/homepage.php#L75-L81
If that string doesn't correspond to a class in the current scope, the homepage of a site will fail to render.
Fatal error: Uncaught Error: Class 'CityLimits' not found in /Users/blk/sites/citylimits/wp-content/themes/Largo/homepages/homepage.php:79
We can fix this by:
largo_get_active_homepage_layout
functionlargo_get_active_homepage_layout
test whether that string is a class that existslargo_get_active_homepage_layout
return an error or debug log output when the class does not existMarking this as
priority: low
because this has only really been problem when switching back and forth between feature branches of child themes that add or remove homepage layouts, and it only breaks the homepage. Sites experiencing this problem can still get into their theme options and change the layout.The text was updated successfully, but these errors were encountered: