Sylius/Sylius — pull request #1193 by ruudkobes (2014-03-12 11:45:28+00:00)
Title: Add validation when saving parameters to guarantee database integrity

Because of #1114, I've looked into the settings management in the SettingsBundle. The error in question results from an incomplete serialized value in the database, which in turn triggers a PHP notice when unserializing. I've added validation to at least prevent corrupt values in the parameters table.

I'm not yet satisfied how this code handles the error, though. Would it be an improvement to add a new ValidatorException which contains the complete ConstraintViolationList that's returned by $validator->validate()? This would also allow the caller of saveSettings (the SettingsController) to display which parameters failed and on which constraints (instead of only the first failing constraint of one parameter.