mjsarfatti/nestedSortable — Issue #13: Elements w/o parents return "null" as a string, instead of empty string, MySQL interprets as 0
Author: tomasm-
Created: 2012-02-04 13:40:11+00:00
State: open

I'm using the 'develop' branch and if rootID is null, then when it gets serialized, it will return "null" as a string, rather than an empty string. This causes problems with MySQL where it interprets the string 'null' for an integer field as invalid and sets it to '0'. My parent_id field gets set to '0' in the database instead of (sql's) NULL.

If it just returns the empty string when rootID is null instead, it will fix it, ie replacing

o.rootID

with

o.rootID?o.rootID:''

everywhere in the file.