All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Conflict with another fieldtype which causes a JS error meaning Low events dropdowns are not working on publish page

BigLittleFlan 2 Oct 2015 09:30 problem, active

Hi,

Been debugging an issue with low events, the dropdowns weren't working and I was getting a JS error of:

Uncaught SyntaxError: Invalid regular expression: /(^|\.)slice !== 'undefined') {
var rest = this(\.|$)/: Unmatched ')'


Had a quick look realised it was line on line 147 of low_events.js when looping through var langKeys var i on the last iteration was set to gmaps_remove https://www.dropbox.com/s/cl3338aob63...

I've added in a simple if to test if i is a number which fixes the issue.

// Check language attributes
var langKeys = ['decimal', 'mins', 'hr', 'hrs'];

for (var i in langKeys) {
if (Number(i) === i && i % 1 === 0) {
var val = $el.data('lang-'+langKeys[i]);
if (val) {
Settings.lang[langKeys[i]] = val;
}
}
}


Guessing it's a conflict with the gMaps fieldtype I use with Content elements, if it helps here are the installed fieldtypes:

Fieldtype Name Version Status
Assets 2.5 Installed
Blockquote 1.0 Installed
CE Tweet 1.3.8 Installed
Checkboxes 1.0 Installed
Content Elements 1.7.1 Installed
File 1.0 Installed
Gmaps fieldtype 2.0.3 Installed
Grid 1.0 Installed
Introvert 1.2 Installed
Low Events 1.4.1 Installed
Low Variables 2.6.1 Installed
Multi Select 1.0 Installed
Radio Buttons 1.0 Installed
Relationships 1.0 Installed
Select Dropdown 1.0 Installed
Structure 3.3.14.7 Installed
Text Input 1.0 Installed
Textarea 1.0 Installed
Textarea (Rich Text) 1.0 Installed
Wygwam 3.3.3 Installed

Replies

  1. Low 2 Oct 2015 11:03

    Hmm, looks like the gmaps add-on changes the JS prototype of the array, which causes the conflict. Rather nasty to do, and not LE's fault, but LE could work around it.

    If you change

    for (var i in langKeys)


    to

    for (var i = 0, l = langKeys.length; i < l; i++)


    it should probably work as well.