JonathanReeve / theme-customeka

Omeka theme allowing advanced customization.
0 stars 2 forks source link

validate customization fields with JS #64

Open CathyHajo opened 10 years ago

CathyHajo commented 10 years ago

On http://njdigitalhistory.org/NJDHA/exhibits/show/williamwinds there is a line of HTML or CSS showing in the upper left that says ' rel='stylesheet' type='text/css'>

Also on some others. We had an odd thing happen that I can't be sure wasn't human error--one of the students customized her exhibit and it seemed to change the customizations for several others-- looking at it now, if looks like they were the ones that are showing this error. (Van Allen House, Presidential Connections, Mastodons) though it is possible that the text is there on all, but not visible.

JonathanReeve commented 10 years ago

Hm I can't reproduce this on my local development versions. I have no idea where this stray code is coming from. I'll email you about setting up git on the server so that it'll be easy to pull in changes and we can see if that fixes it.

CathyHajo commented 10 years ago

I figured it out. What I think happened, and I'm not sure, is that somehow the customizations that one student did on Elementaire were copied to all exhibits that had NO configurations on them. So this crazy mastodon theme appeared on all the non-Configured sites with Elementaire. Instead of putting the font name in the field, she put in the link to the font, I'm guessing, which created the bad code. If I delete that line, the error goes away.

She didn't edit the other exhibits manually, but somehow what she did was carried onto a bunch of the new ones and all the old ones, which have lost their customizations.

Confusing!

CathyHajo commented 10 years ago

I figured it out. I think she accidentally edited the Elementaire theme at the site level, and those settings stuck when she saved it. I edited the theme and after that, new exhibits using Elementaire came up with those customizations.

JonathanReeve commented 10 years ago

So on William Winds the random HTML is still there. That seems to be because the student wrote HTML in the font field, instead of using the name of the font. That is, instead of writing "Finger Paint," he wrote "." I went in and manually edited this in the configuration. I'll add a filter in Elementaire that ignores HTML where it shouldn't be, or do some error checking, so that students who erroneously enter HTML in text fields won't break the theme.

JonathanReeve commented 9 years ago

I think this issue speaks to a larger issue that there really isn't any validation in place for the customization options. There should be checks to make sure colors are valid colors, and fonts are valid fonts. I'll change this issue title to reflect that, and slate it for 3.1.