apostrophes breaking pages
#113 opened by jlopezuy
Description
we have purchased and ansel license for Craft.
within our articles structure we have (among other stuff), a simple text field, and an ansel with 2 handlers.
when we create an article, with an apostrophe (ยด) in the text field, images are saved, and entry looks ok.
when you edit the entry and we replace the image the call to
entry.mainImageResponsive.one().mobile.one()
returns null, so twig returns an error (I know we put a conditional here, but we need to show the content anyways)
the only way to fix the entry is to go in, and remove the apostrophe from the text field
are you aware of this issue? I'm not sure it's either Carft, Ansel, or both.
thanks in advance
Jose
Replies
- TJ Draper
Replied 7/4/2018 4:02 PM, Edited 11/10/2018 9:48 AM
Hello,
I have been unable to produce any issues with apostrophe's in Ansel's Title or Caption field. If apostrophes in another field type is producing an error that would be beyond the scope of Ansel.
Also I notice something weird in your example. You're calling:
entry.mainImageResponsive.one().mobile.one()
If
mainImageResponsive
is an image that would most certainly throw an error as.mobile
is not a valid property or function from the AnselImageModel. If you have an image transform calledmobile
you might be looking forentry.anselTestingField.one().getAsset().getUrl('mobile')
- jlopezuy
Replied 7/16/2018 2:40 PM, Edited 11/10/2018 9:48 AM
hi, I contacted craft support, provided them with FTP and CP credentials, they looked into our implementation, and said it's likely caused by the Ansel plugin:
"I don't think it has anything to do with an apostrophe at all, but whenever an image is removed from that "main responsive image" mobile and desktop fields, then new ones are re-added, it looks like the next time you load the page after that, it's broken. I went back in to edit the entry after that error and just re-saved it (without making any changes and still including the apostrophe) and the front-end started working again.
I'm not sure what type of field that is, but it looks like it's coming from a plugin... maybe it's a bug in the plugin?"
Is there any chance you can help us debug this issue? Thanks
- TJ Draper
Replied 7/19/2018 5:43 PM, Edited 11/10/2018 9:48 AM
In order to debug this issue further I'll need to be able to reproduce it solidly. So I'll need exact steps to reproduce the issue. Right now the issue is a tad vague and I'm not able to reproduce it with either apostrophes or other characters in a separate text field, or in any either of Ansel's text fields.
If you can create a reduction template and environment in which this is happening and list the steps you took to get there that would be extremely helpful in helping track this down.
As it is, it's very difficult for me to see how an apostrophe in a text field (as far as I can tell from what you've said, a text field separate and distinct from the Ansel field) can have anything whatever to do with Ansel.