When a product using PayPal Buttons is viewed, PayPal Buttons unsets the submit element in the add-to-cart form and inserts a button or image of its own. I'm seeing a problem when the new element is an image. Something is prefixing the source of the image with a slash, so that it looks like this:
<input type="image" name="op" value="Subscribe Now" id="edit-paypal-button" class="form-submit" src="//images/join-now.jpg" />
That, well, 404s. I could remove the slash I've prefixed the URL with, but then the preview image wouldn't show on the node edit form.
After much digging around, I've determined that the problem is in theme_image_button(), which prefixes every image source with base_path(). At a minimum, that's going to be a "/".
<irony>
The single comment on the API page for theme_image_button() is Joe's, where he notes that this behavior means that external URLs cannot be used for image buttons. Joe also uses a modified version of theme_image_button() in the D5 version of PayPal Buttons so as to get around this behavior. Which is why my issue never reared its head under D5.
</irony>
Marking this as a bug in this module, though, since even if the URL is "correctly" entered the preview doesn't display.
I have a working fix; I'll roll a patch tomorrow and post it.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | uc_paypal_buttons-image_buttons-1271562-1.patch | 1.49 KB | mrtoner |
Comments
Comment #1
mrtoner commentedAnd the promised patch...