Css load content failure

Since updating to WordPress 4.8 now getting a
“Failed to load content css” in the Book Info.

We haven’t confirmed WordPress 4.8 support yet (see: https://github.com/pressbooks/pressbooks/issues/765). Which book theme are you using?

All books on PB are using Open Textbooks theme

Also noteworthy is the same error can be found in any window that uses the editor (i.e., edit Chapter). Therefore, it seems to be a WP Pressbooks issue related to the editor that occurs on every book site.

Hi Steve, can’t reproduce this with Open Textbooks theme (3.0.2.2) plus Pressbooks 3.9.9 plus WordPress 3.8.0. Does that file exist? E.g. can you paste http://<your-url>/wp-content/uploads/sites/17/css/editor.css into the browser and load it?

(Paging @brad—you run into any issues with Pressbooks Textbook and WP 4.8.0?)

I have not run into any issues with PBT and WP 4.8.0

Pressbooks Version 3.9.10
Pressbooks mPDF Version 1.7.0
Pressbooks Textbook Version 3.0.2.2
WordPress 4.8

Same issue in latest PB. Also same issue on a development server. I have found 2 out of 8 books that did not have this issue, but cannot find any reason why.

I have tested in different browsers with same result. I do recall on a non-PB site that upgrading to WP 4.8 also had an update for TinyMCE Advanced - don’t know if this is related to the load content css failure.


Also ran the query monitor 2.13.4 plugin which gave the following for the book with the issue:

PHP Error Count Location Call Stack Component
Notice (Suppressed) Undefined index: page 1 wp-content/plugins/pressbooks-textbook/includes/modules/search/class-pbt-apisearch.php:457 PBT\Search\ApiSearch::isFormSubmission()
wp-content/plugins/pressbooks-textbook/includes/modules/search/class-pbt-apisearch.php:55
PBT\Search\ApiSearch::formSubmit()
wp-includes/class-wp-hook.php:298
do_action(‘init’)
wp-settings.php:448 Plugin: pressbooks-textbook
Undefined index: page 1 wp-content/plugins/pressbooks/includes/modules/export/class-pb-export.php:810 Pressbooks\Modules\Export\Export::isFormSubmission()
wp-content/plugins/pressbooks/includes/modules/export/class-pb-export.php:577
Pressbooks\Modules\Export\Export::formSubmit()
wp-includes/class-wp-hook.php:298
do_action(‘init’)
wp-settings.php:448 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/modules/import/class-pb-import.php:463 Pressbooks\Modules\Import\Import::isFormSubmission()
wp-content/plugins/pressbooks/includes/modules/import/class-pb-import.php:235
Pressbooks\Modules\Import\Import::formSubmit()
wp-includes/class-wp-hook.php:298
do_action(‘init’)
wp-settings.php:448 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/class-pb-customcss.php:195 Pressbooks\CustomCss::isFormSubmission()
wp-content/plugins/pressbooks/includes/class-pb-customcss.php:143
Pressbooks\CustomCss::formSubmit()
wp-includes/class-wp-hook.php:298
do_action(‘init’)
wp-settings.php:448 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/class-pb-catalog.php:1008 Pressbooks\Catalog::isFormSubmission()
wp-content/plugins/pressbooks/includes/class-pb-catalog.php:981
Pressbooks\Catalog::formSubmit()
wp-includes/class-wp-hook.php:298
do_action(‘init’)
wp-settings.php:448 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/admin/pb-laf.php:565 Pressbooks\Admin\Laf\init_css_js()
wp-includes/class-wp-hook.php:298
do_action(‘admin_init’)
wp-admin/admin.php:154 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/admin/pb-laf.php:572 Pressbooks\Admin\Laf\init_css_js()
wp-includes/class-wp-hook.php:298
do_action(‘admin_init’)
wp-admin/admin.php:154 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/admin/pb-laf.php:579 Pressbooks\Admin\Laf\init_css_js()
wp-includes/class-wp-hook.php:298
do_action(‘admin_init’)
wp-admin/admin.php:154 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/admin/pb-laf.php:587 Pressbooks\Admin\Laf\init_css_js()
wp-includes/class-wp-hook.php:298
do_action(‘admin_init’)
wp-admin/admin.php:154 Plugin: pressbooks


Book without issue:

PHP Error Count Location Call Stack Component
Notice (Suppressed) Undefined index: page 1 wp-content/plugins/pressbooks-textbook/includes/modules/search/class-pbt-apisearch.php:457 PBT\Search\ApiSearch::isFormSubmission()
wp-content/plugins/pressbooks-textbook/includes/modules/search/class-pbt-apisearch.php:55
PBT\Search\ApiSearch::formSubmit()
wp-includes/class-wp-hook.php:298
do_action(‘init’)
wp-settings.php:448 Plugin: pressbooks-textbook
Undefined index: page 1 wp-content/plugins/pressbooks/includes/modules/export/class-pb-export.php:810 Pressbooks\Modules\Export\Export::isFormSubmission()
wp-content/plugins/pressbooks/includes/modules/export/class-pb-export.php:577
Pressbooks\Modules\Export\Export::formSubmit()
wp-includes/class-wp-hook.php:298
do_action(‘init’)
wp-settings.php:448 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/modules/import/class-pb-import.php:463 Pressbooks\Modules\Import\Import::isFormSubmission()
wp-content/plugins/pressbooks/includes/modules/import/class-pb-import.php:235
Pressbooks\Modules\Import\Import::formSubmit()
wp-includes/class-wp-hook.php:298
do_action(‘init’)
wp-settings.php:448 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/class-pb-customcss.php:195 Pressbooks\CustomCss::isFormSubmission()
wp-content/plugins/pressbooks/includes/class-pb-customcss.php:143
Pressbooks\CustomCss::formSubmit()
wp-includes/class-wp-hook.php:298
do_action(‘init’)
wp-settings.php:448 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/class-pb-catalog.php:1008 Pressbooks\Catalog::isFormSubmission()
wp-content/plugins/pressbooks/includes/class-pb-catalog.php:981
Pressbooks\Catalog::formSubmit()
wp-includes/class-wp-hook.php:298
do_action(‘init’)
wp-settings.php:448 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/admin/pb-laf.php:565 Pressbooks\Admin\Laf\init_css_js()
wp-includes/class-wp-hook.php:298
do_action(‘admin_init’)
wp-admin/admin.php:154 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/admin/pb-laf.php:572 Pressbooks\Admin\Laf\init_css_js()
wp-includes/class-wp-hook.php:298
do_action(‘admin_init’)
wp-admin/admin.php:154 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/admin/pb-laf.php:579 Pressbooks\Admin\Laf\init_css_js()
wp-includes/class-wp-hook.php:298
do_action(‘admin_init’)
wp-admin/admin.php:154 Plugin: pressbooks
Undefined index: page 1 wp-content/plugins/pressbooks/includes/admin/pb-laf.php:587 Pressbooks\Admin\Laf\init_css_js()
wp-includes/class-wp-hook.php:298
do_action(‘admin_init’)
wp-admin/admin.php:154 Plugin: pressbooks


no conclusion

all the editor.css files exist and can be loaded directly from the URL

This is a known issue with WP 4.8. It may have something to do with permissions on the upload folder, I don’t know but reverting to 4.7.5 will clear the problem.

The default permissions at CHMOD 775, which are the same for other folders, is considerably unrestricted and not likely to be the cause of the issue. Also reinstalling an old WP version has it’s own potential issues.

As I say, I am guessing but I’m not referring to the server permissions - it was the same on Windows Xampp, which does not recognise CHMOD in any form. I mean there must be some new coding. Anyway there is enough similar complaints on the web if you google it, since the release of 4.8. Reverting to 4.7.5 does cure it, I can confirm at least for me.

I’m not sure of issues reinstalling, I’ve done it many times and never had a problem but if you have dependencies that need 4.8, since your upgrade, possibly?

We’re getting the same error on our Unizin hosted instance as well. I’m happy to do some testing/exploration if it’d be helpful?

That would be useful. I’m about to take it live to my server which is a development one that allows administrator access. I’m sticking to 4.7.5 until an official solution. Wordpress don’t seem to see it as bug and are expecting plugin developers affected to update.

In any case I’ve installed Easy Updates Manager, which is multisite compatible and after much testing works well with 3.9.9.

Hi all, found a good explanation for what’s happening on a WP 4.8 support forum: https://wordpress.org/support/topic/read-this-first-wordpress-4-8-master-list/#post-9221234. @Ned, do we know if any of the bulleted options articulated in that explanation might be happening with generic PB installs?

1 Like

That editor.css file is an auto-generated file. It’s triggered on admin_init or when you update some theme options Ie.

add_action( 'update_option_pressbooks_global_typography', '\Pressbooks\Admin\Fonts\update_font_stacks' );
add_action( 'update_option_pressbooks_theme_options_web', '\Pressbooks\Admin\Fonts\update_font_stacks' );

> Link to code <

To fix (or test) Go to [ Appearance -> Theme Options ] In the [Global Options ] tab, add a new language in Language Support. This will regenerate the editor.css file. The warning will go away.

If it does not regenerate the file, then investigate permissions. Pressbooks needs chmod access to uploads/sites/17/css/editor.css Check your server logs for any errors about not being able to create that file.

Oh?

The link in the warning is http://

Are you accessing the admin interface over https:// ?

@SteelWagstaff has posted a good link.

For those experiencing the problem please look at the network tab in Chrome. If the file is not there you will see:

If the file is there, please post the contents. According to the link it’s possible that the embeded @import is broken.

Thanks @dac.chartrand. The file is there in my case. Here’s one example of a CSS file that failed to load: https://wisc.pb.unizin.org/pressbooks101/wp-content/uploads/sites/67/css/editor.css. I’m guessing the initial import line is the most likely culprit–in this case it is @import ‘components/structure/index’. The books with the error message are currently using @brad’s Open Textbook theme. When I switch to other themes (like Austen Classic, for example), the warning disappears.

1 Like

I tried Austen theme and had the same issue. Therefore switching themes for me did not work.

Thanks but this did not fix the issue.