Sprout SEO: Getting error on save, preventing updating "default" meta data After creating a default meta entry in Sprout SEO. Any subsequent updates aren't saved and I get an error message "Couldn't save the default"

Using:


Craft 2.4.2725
Sprout SEO 1.1.1


Has anyone else come across this?
This issue came as a result of the MySQL DB sql_mode including the NO_AUTO_VALUE_ON_ZERO mode which affects how auto_increment columns work. When trying to create a new row entry it will only auto_increment if null is passed.

Full explanation here:

http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_auto_value_on_zero

This setting matched with the way the controller's actionSaveDefault function was setting the id to a blank value rather than a null value caused it to trigger this DB behavior of writing a 0 rather than auto_increment.

While the cause of the issue is not Craft or SproutSEO specific, this answer might help anyone else with the issue.


Check your MySQL DB sql_mode 
If, NO_AUTO_VALUE_ON_ZERO is set make sure you're passing null if you want it to auto_increment