omeka / plugin-Contribution

Makes an Omeka site into one that accepts public contributions. The plugin provides a form to collect stories, images, or other files from the public and manages those contributions in your Omeka archive as items. This contribution is useful when creating digital memory banks
http://omeka.org/codex/Plugins/Contribution
8 stars 15 forks source link

Drop-down for Item Type on Form broken in Explorer #70

Closed wcaleb closed 6 years ago

wcaleb commented 6 years ago

The Contribution form never appears in Internet Explorer, even after an Item Type is selected from the drop-down select menu.

My research suggests the problem is with this line in contribution-public-form.js.

Namely, append() is not supported in Internet Explorer. This probably needs a polyfill or a refactoring but I'm not sure the best way to go about it.

zerocrates commented 6 years ago

form in this case is a jQuery object, so it's jQuery's append that's being called, not the DOM function you linked to.

Do you get an error implicating that line in the IE console? What version of IE is this (I'm assuming 11)?

zerocrates commented 6 years ago

I tried this out, just very quickly, and had no problem on IE 11.

wcaleb commented 6 years ago

I do get an error implicating that line and it just says it’s a syntax error.

, 2018, at 5:35 PM, John Flatness notifications@github.com wrote:

I tried this out, just very quickly, and had no problem on IE 11.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

zerocrates commented 6 years ago

Is the site showing the problem available at some URL?

wcaleb commented 6 years ago

https://harveymemories.org/contribution

zerocrates commented 6 years ago

Yeah, I can confirm the issue on your site. This "syntax error" or other unspecified error nonsense is one of the worst parts of trying to deal with IE.

I think what's happening is that it's actually complaining about what jQuery's doing when the append is called. The relevant bit of what it will do is execute any script blocks that came back from the AJAX request for the type form. You've got some custom stuff going on in there, namely scripts for running a datepicker widget and for adding some explanatory text to the map, it looks like.

If you look at the Network tab, you'll see IE downloads the datepicker JS file, but not the map explanation one, which comes later. This leads me to think that it's the datepicker JS that's actually the culprit.

Looking at that datepicker script , my attention is drawn to the comments at the bottom: those are HTML comments. This is a common enough mistake that the other browsers apparently support them and don't even complain about them, but my guess would be that IE doesn't. I think removing those comments will likely fix the issue.

I'm actually a little surprised that the other browsers don't complain about this at all, but they don't (you can try putting an HTML comment in the Chrome console, it just happily returns undefined and raises no error).

zerocrates commented 6 years ago

Actually now that I look at it, supporting HTML comments is actually required by the standard. That's kind of sad.

Of course, IE doesn't actually support that version of the standard, so. Learn something every day.

image

zerocrates commented 6 years ago

whoops, that previous comment was supposed to actually link the script in question, it's this:

https://harveymemories.org/plugins/Contribution/views/public/javascripts/datepicker.js

wcaleb commented 6 years ago

I removed the comments from datepicker, and it now works! Can't believe that did it, but it did. Thank you very much for your help!