Image centering / Theme loading issues


#1

Hi,

I am having an issue with image centering on the web version of my book. I have exhausted all resources and cannot find any documentation of a bug of any kind.

The issue is that an image appears centered in the edit chapter window but when the image is viewed, it is not. All the other alignment tools (L, R,) work fine. Here is the code for a sample image. And see screen shots below.

[caption id=“attachment_173” align=“aligncenter” width=“216”]Portrait of Jean-Jacques Rousseau from the profilings to torso. Rousseau is slightly smiling and seemingly looking at the viewer. The color palette is simple, using neutral tones and depicting Rousseau in front of a dark, shadowing background. .[/caption]


Theme loading issues
#2

Which theme in which version are you using? Did you add any Custom CSS to the theme?


#3

PB v 5.6.5. No custom CSS. I am currently using v 2.1.5 of the Open Textbooks theme.


#4

I do did not find the Open Textbooks theme on https://github.com/pressbooks, so could not test this. But on the theme I am using right now (Jacobs on PB 5.6.5) the centering is done via the class aligncenter and its rules margin-left:auto and margin-right:auto. See printscreen. You should see something similar with the browser inspector in your theme. If you do not see the class and the rules, then that would explain the failed centering.


#5

Hmm. Looks OK. I changed the theme to Jacobs and am having the same issue.


#6

I’m now thinking this might be a server side issue (see the 12 internal server errors on the screenshot above). None of the style information in ANY of the themes are being applied and I’m getting these errors:

What do you think is wrong here?


#7

Difficult to say, without having access to the book. But it definately looks like an issue on the server.


#8

I had my local admin look into this and he is stumped. None of my themes are loading. They all appear the same, even though they are loaded with different themes. Does anyone have any guidance they can give? I think it is larger than image centering at this point.

This book currently has McLuhan activated but has none of the styling info.

This book has Open Textbooks activated and has no discernible styling info.


Theme loading issues
#9

Hi Thomas and @jlsmith the Open Textbook theme is not a theme made or maintained by Pressbooks. It was written by @brad (Brad Payne), our friend at colleague at BCcampus as part of his Open Textbooks plugin. It doesn’t appear that this issue is particular to that particular theme, however, so I don’t know that Brad will have any special insight into your problem, Jeremy.


#10

Pressbooks v. 5.6.5
Open Textbooks Version: 2.1.5
McLuhanVersion: 2.4.3

I originally posted about this in the Editing category because I thought it was a smaller issue, but I now think it’s a larger server side issue and my local admin is not very well versed in PB so he could not help. Here is the original post.

None of my themes appear to be loading. All my books look the same, even with different themes.

This book currently has McLuhan activated but has none of the styling info.

This book has Open Textbooks activated and has no discernible styling info.

Could be a simple thing on the admin side I’m missing or a server side thing. If it is a server-side issue, I will need to pass it on to my local server admin because I do not have access.


#11

Hi Jeremy,
It looks to me like an issue with how Pressbooks (and its themes) are installed and configured on your server. I’ve cloned the Yanaihara Tadao book to another network and the GWS introduction and both look fine there. We might be able to help diagnose further if you were to copy/paste the contents of your diagnostics page (accessible from the dashboard footer) here.


#12

Thanks Steel. Here is the diagnostics info from the Network Admin Dashboard and one of the books. (not sure there is a difference).

System Information

Root Blog Info

Root Blog ID: 1
Root Blog URL: http://openbooks.library.umass.edu/

Browser

Platform: OS X
Browser Name: Safari
Browser Version: 12.0.3
User Agent String: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15

WordPress Configuration

Network URL: http://openbooks.library.umass.edu/
Network Type: Subdirectory
Version: 5.1
Language: en_US
WP_ENV: Not set
WP_DEBUG: Disabled
Memory Limit: 64M

Pressbooks Configuration

Version: 5.6.5
Root Theme: Pressbooks Publisher
Root Theme Version: 3.1.4

Pressbooks Dependencies

Epubcheck: Installed
Kindlegen: Not Installed
xmllint: Installed
PrinceXML: Not Installed
Saxon-HE: Installed

Must-Use Plugins

hm-autoloader.php: n/a

Network Active Plugins

H5P: 1.13.0
Hypothesis: 0.5.0
mPDF for Pressbooks: 3.2.4
Openstax Import for Pressbooks: 1.2.4
Pressbooks: 5.6.5
Textbooks for Pressbooks: 4.2.3
WP Designer: 2.2.2
WP QuickLaTeX: 3.8.6

Root Blog Active Plugins

H5P: 1.13.0
Hypothesis: 0.5.0
mPDF for Pressbooks: 3.2.4
Openstax Import for Pressbooks: 1.2.4
Pressbooks: 5.6.5
Textbooks for Pressbooks: 4.2.3
WP Designer: 2.2.2
WP QuickLaTeX: 3.8.6

Inactive Plugins

Akismet Anti-Spam: 4.1.1
Hello Dolly: 1.7
WordPress Easy SMTP: 1.1.2

Server Configuration

PHP Version: 7.2.15-0ubuntu0.18.04.1
MySQL Version: 5.7.25
Webserver Info: Apache/2.4.29 (Ubuntu)

PHP Configuration

Safe Mode: Disabled
Memory Limit: 256M
Upload Max Size: 2M
Post Max Size: 8M
Upload Max Filesize: 2M
Time Limit: 30
Max Input Vars: 1000
URL-aware fopen: On (1)
Display Errors: N/A

PHP Extensions

OPcache: Zend
XDebug: Disabled
cURL: Supported
cURL Version: 7.58.0
imagick: Not Installed
xsl: Installed

Here is one from the Women, Gender Studies book:

System Information

Book Info

Book ID: 6
Book URL: http://openbooks.library.umass.edu/introwgss/
Book Privacy: Public

Browser

Platform: OS X
Browser Name: Safari
Browser Version: 12.0.3
User Agent String: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15

WordPress Configuration

Network URL: http://openbooks.library.umass.edu/
Network Type: Subdirectory
Version: 5.1
Language: en_US
WP_ENV: Not set
WP_DEBUG: Disabled
Memory Limit: 64M

Pressbooks Configuration

Version: 5.6.5
Book Theme: Open Textbooks
Book Theme Version: 2.1.5
Root Theme: Pressbooks Publisher
Root Theme Version: 3.1.4

Pressbooks Dependencies

Epubcheck: Installed
Kindlegen: Not Installed
xmllint: Installed
PrinceXML: Not Installed
Saxon-HE: Installed

Must-Use Plugins

hm-autoloader.php: n/a

Network Active Plugins

H5P: 1.13.0
Hypothesis: 0.5.0
mPDF for Pressbooks: 3.2.4
Openstax Import for Pressbooks: 1.2.4
Pressbooks: 5.6.5
Textbooks for Pressbooks: 4.2.3
WP Designer: 2.2.2
WP QuickLaTeX: 3.8.6

Book Active Plugins

H5P: 1.13.0
Hypothesis: 0.5.0
mPDF for Pressbooks: 3.2.4
Openstax Import for Pressbooks: 1.2.4
Pressbooks: 5.6.5
Textbooks for Pressbooks: 4.2.3
WP Designer: 2.2.2
WP QuickLaTeX: 3.8.6

Inactive Plugins

Akismet Anti-Spam: 4.1.1
Hello Dolly: 1.7
WordPress Easy SMTP: 1.1.2

Server Configuration

PHP Version: 7.2.15-0ubuntu0.18.04.1
MySQL Version: 5.7.25
Webserver Info: Apache/2.4.29 (Ubuntu)

PHP Configuration

Safe Mode: Disabled
Memory Limit: 256M
Upload Max Size: 2M
Post Max Size: 8M
Upload Max Filesize: 2M
Time Limit: 30
Max Input Vars: 1000
URL-aware fopen: On (1)
Display Errors: N/A

PHP Extensions

OPcache: Zend
XDebug: Disabled
cURL: Supported
cURL Version: 7.58.0
imagick: Not Installed
xsl: Installed


#13

Thanks Jeremy. When did you notice these issues begin to appear for you? Was it after an update of some kind?


#14

I just produced a diagnostics readout for one of our hosted networks where these cloned books aren’t producing the same issues. Here are some differences on our network (bolded):

WordPress Configuration

Version: 5.0.3
WP_ENV: production
WP_DEBUG: Disabled

Pressbooks Configuration

Version: 5.6.5
Root Theme: Aldine
Root Theme Version: 1.5.0

Network Active Plugins

We do not have any of the following installed (or network activated):
Openstax Import for Pressbooks: 1.2.4
Textbooks for Pressbooks: 4.2.3
WP Designer: 2.2.2

Root Blog Active Plugins

H5P: 1.11.3

Server Configuration

PHP Version: 7.1.23-3+ubuntu16.04.1+deb.sury.org+1
MySQL Version: 5.5.5
Webserver Info: nginx/1.13.6


#15

Quick human readable summary:

  1. We haven’t updated WP to 5.1 on that network (this will be required for our forthcoming 5.7 release, however).
  2. We’re running Aldine as the network theme instead of Pressbooks Publisher (see https://docs.pressbooks.org/changelogs/pressbooks-aldine/).
  3. You have some additional plugins installed and network activated. We can’t advise you on what these plugins do or if they’re causing issues. We haven’t updated our version of H5P to the latest release on the server in question, but I doubt that is the issue at hand.
  4. We’re running different versions of PHP & MySQL and we use nginx instead of Apache.

I don’t have any deep insight into the errors your reporter earlier, but just thinking aloud – here are some quick things you could try: revert WP to 5.0.3, deactivate the those plugins, install Aldine. Much more than that I probably can’t help with, except to say that we’d be happy to host your instance as one of our PressbooksEDU plans.


#16

Thanks @SteelWagstaff. These are all good things to try.

To be honest, I didn’t really notice when these issues first appeared because we were part of the OTN/Rebus pilot where I wasn’t responsible for back end Pressbooks work. We made a local decision to go with the self-hosted PressbooksEDU option and the install was handled by our local systems folk. Since the install I haven’t had an opportunity to do a deep dive into any of our projects. I have been occasionally logging in and automatically updating things when WP told me too, not really considering the repercussions. I noticed it last week when a project that is ramping up towards completion was having the image centering issue and then I realized that there were these additional theme issues which I hadn’t considered before. I did move over to Pressbooks Publisher about a month ago, so maybe that had something to do with it?

I will try these steps and let you know how it goes!


#17

OK. I moved over to Aldine and turned off the plugins and am still seeing the issues so I will have our systems folks revert to WP 5.0 and see what they think about the PHP MySQL and nginx suggestions.

System Information

Root Blog Info

Root Blog ID: 1
Root Blog URL: http://openbooks.library.umass.edu/

Browser

Platform: OS X
Browser Name: Safari
Browser Version: 12.0.3
User Agent String: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15

WordPress Configuration

Network URL: http://openbooks.library.umass.edu/
Network Type: Subdirectory
Version: 5.1
Language: en_US
WP_ENV: Not set
WP_DEBUG: Disabled
Memory Limit: 64M

Pressbooks Configuration

Version: 5.6.5
Root Theme: Aldine
Root Theme Version: 1.4.1

Pressbooks Dependencies

Epubcheck: Installed
Kindlegen: Not Installed
xmllint: Installed
PrinceXML: Not Installed
Saxon-HE: Installed

Must-Use Plugins

hm-autoloader.php: n/a

Network Active Plugins

H5P: 1.13.0
Hypothesis: 0.5.0
mPDF for Pressbooks: 3.2.4
Pressbooks: 5.6.5

Root Blog Active Plugins

H5P: 1.13.0
Hypothesis: 0.5.0
mPDF for Pressbooks: 3.2.4
Pressbooks: 5.6.5

Inactive Plugins

Akismet Anti-Spam: 4.1.1
Hello Dolly: 1.7
Openstax Import for Pressbooks: 1.2.4
Textbooks for Pressbooks: 4.2.3
WordPress Easy SMTP: 1.1.2
WP Designer: 2.2.2
WP QuickLaTeX: 3.8.6

Server Configuration

PHP Version: 7.2.15-0ubuntu0.18.04.1
MySQL Version: 5.7.25
Webserver Info: Apache/2.4.29 (Ubuntu)

PHP Configuration

Safe Mode: Disabled
Memory Limit: 256M
Upload Max Size: 2M
Post Max Size: 8M
Upload Max Filesize: 2M
Time Limit: 30
Max Input Vars: 1000
URL-aware fopen: On (1)
Display Errors: N/A

PHP Extensions

OPcache: Zend
XDebug: Disabled
cURL: Supported
cURL Version: 7.58.0
imagick: Not Installed
xsl: Installed


#18

The debugging info you are posting is not going to help much. If you want to keep posting it I suggest using the [ details ] tag to make it easier for us to read your posts.

Example

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer placerat et sapien sed faucibus. Aliquam vitae dignissim diam. Nam quam felis, molestie ac congue nec, congue faucibus purus. Pellentesque lacinia aliquet varius. Integer pharetra diam nec nulla pretium pellentesque. Nulla sed nulla scelerisque, tempor nisl sed, gravida diam. Nam ut risus porta, bibendum dolor vitae, porttitor quam.

Can I also ask that you please keep your posts in the same thread? This is all the same problem to me, spreading everything out accross multiple threads makes it harder for us to help.

A white page, or an error 500 as seen in your previous post means “Check the logs”

Without the error logs (PHP & Apache/Nginx) there isn’t much to say.

My feeling is either your redirect rules are wrong or you haven’t installed some missing dependencies.


#19

I deleted and reinstalled the root theme and have been trying each theme one at a time. Jacobs & McLuhan work as expected, however my original problem remains: all other themes besides Jacobs & McLuhan will not center images. Here is an example page in Austen Classic: http://openbooks.library.umass.edu/introwgss/chapter/intersectionality/. The image of the sponges will not center.

At this point, that appears to be the only issue. All of the 500 errors from before are gone.


#20

Hi Jeremy–glad you got most of the errors fixed. Had a quick look at the example you sent and the problem I see is a CSS issue. I see a rule that sets the figure margin like this figure { margin: 0 0 1rem;}

For a centered figure (which has a class=aligncenter), the rule should probably be margin: 0 auto;

I don’t know the origin of the aberrant CSS – could it perhaps be from custom CSS that you’ve inserted in the book? If not, then this seems like something that could be reported as a bug in the theme stylesheet.