Problem

Getting the following error in console log:

Uncaught SyntaxError: Unexpected token , in JSON at position 471

Happens on this line, when loading up the config for the slider instance:

const options = JSON.parse(settings.gliderjs[el.id]);

Empty or lack of default values on the breakpoint settings seem to be the root cause of this.

Steps to reproduce

  1. Setup field with the gliderjs field formatter.
  2. Save settings on field formatter, without entering in any values for the breakpoints.
  3. View slider and inspect console log for js error.

Proposed resolution

Set default values or possibly don't save breakpoint settings unless being explicitly used?

Comments

geoanders created an issue. See original summary.

geoanders’s picture

Title: Breakpoint config settings causing JS error » Breakpoints config settings causing JS error
Related issues: +#3261144: Select which breakpoints will be used in configuration form
geoanders’s picture

geoanders’s picture

slydevil’s picture

Status: Active » Needs review

  • adriancid committed c35cdeb on 1.0.x authored by geoanders
    Issue #3271306 by geoanders, slydevil, adriancid: Breakpoints config...
adriancid’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.