mgsisk / webcomic

Comic publishing power for the web. Turn your WordPress-powered site into a comic publishing platform with Webcomic.
http://wordpress.org/plugins/webcomic
GNU General Public License v2.0
110 stars 29 forks source link

"buy original page" code sometimes causes "500 Internal Server Error" #266

Closed jameysharp closed 6 years ago

jameysharp commented 8 years ago

I'm trying to help Kel McDonald fix a bug that's causing my site, Comic Rocket, to be unable to index her comic, Sorcery 101. My apologies, but I don't have any access to her server, so I'm trying to debug blind. This comic appears to be using Webcomic 4.1.0.4.

The symptom I see is that some pages consistently respond with HTTP status 500, even though most of the page renders correctly. Those pages differ from the ones that are OK by cutting off output after writing:

<span class='print-available'>The original page is available for <strong>

(Plus a JavaScript fragment that apparently WordPress tacks onto the end of the response body.)

Pages that respond with status 200 follow that output with a price, PayPal link, and the rest of the page.

So I'm guessing the code emitting the "buy this page" message is dying, perhaps on pages where the original art has already sold.

Pages currently showing this bug include 1221 and 1234.

Is this a known issue fixed in a release newer than 4.1.0.4? I can't tell if this is a duplicate of issue #257, for instance.

mgsisk commented 8 years ago

Apologies @jameysharp; I'm not entirely sure if this was an issue addressed in a more recent Webcomic update. One potential fix that shouldn't require an update, however, would be to wrap the print purchasing code in a webcomic_prints_available() check, like:

<?php if (webcomic_prints_available(true)) : /* `true` here tells Webcomic to check that an original print is available */ ?>

<!-- Code that displays the print purchasing options... -->

<?php endif; ?>