When I edit a node with empty nodewords data, the lat/lon field is populated with a serialized value.
This makes the node form fail validation on submit.

The only way to pass validation is to change the lat/lon fields to valid lat/lon values, or delete them entirely.
The fact that it's *possible* to submit the nodeform with this intervention is why I did not mark this a critical issue, but this is a major problem.

The issue of serialized data has been raised before, but only with respect to rendering.
This issue is with respect to values on the node form.

I am working on a patch for this, or trying to figure out if this is something specific to my instance.
I find it hard to believe that no one else has reported this, given the symptom.

Comments

aaronbauman’s picture

following up on this:
the values are actually stored in the database as twice-serialized arrays, which more or less explains the cause.
e.g.

a:2:{s:8:"latitude";s:71:"a:2:{s:8:"latitude";s:9:"39.949733";s:9:"longitude";s:10:"-75.168146";}";s:9:"longitude";i:0;}

wtf.

I'm going to post a cleanup script to this issue just in case anyone else runs into this.

aaronbauman’s picture

Status: Active » Fixed

Again, I have no idea how my DB got borked -- figuring out whether this is a bug in nodewords is left as an exercise for the reader.

Anyway, in case anyone else runs into this, here's the SQL I ran to fix the DB.

If you run into this, you might want to just make sure that the values you're replacing look like the ones that were in my DB.
Note that the order is important here because the first statement relies on a string value that gets replaced in the second:

; step 1: *** back up your database first ***
; step 2: *** no seriously. back up your database ***
UPDATE nodewords 
  SET content = REPLACE(content, ";}\";s:9:\"longitude\";i:0;}", ";}")
  WHERE content LIKE "a:2:{s:8:\"latitude\";s:71:\"a:2:{s:8:\"latitude\";s:%";
UPDATE nodewords 
  SET content = REPLACE(content, "a:2:{s:8:\"latitude\";s:71:\"a:2:{s:8:\"latitude\";s:", "a:2:{s:8:\"latitude\";s:")
  WHERE content LIKE "a:2:{s:8:\"latitude\";s:71:\"a:2:{s:8:\"latitude\";s:%"

Status: Fixed » Closed (fixed)

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

digitalfrontiersmedia’s picture

Incidentally, it appears that this problem starts by inserting the serialized string into your default Meta Tags settings for Lat/Long. After that, every node you create, edit, or otherwise submit ends up with this errant data. In addition to the script above, go and clear out or correct that default setting to prevent the issue from propagating.