FriendsOfSymfony/FOSUserBundle — pull request #901 by iainsaxon (2012-12-18 05:46:32+00:00)
Title: Removed deprecated MinLength/MaxLength validation rules

Replaced occurrences of separate MinLength/MaxLength rules with Length validation rule.

Without these changes Symfony2 v2.2.0 will fail when updating the password and triggering a validation rule.

The final error that is displayed is:

FatalErrorException: Error: Maximum execution time of 30 seconds exceeded in /mywebapp/app/cache/dev/classes.php line 8856

The cause for this timeout is constant writing of deprecated validation method notices to the development log file:

[2012-12-18 16:31:33] deprecation.WARNING: MinLength is deprecated since version 2.1 and will be removed in 2.3. {"type":-100,"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MinLength.php","line":31,"stack":[{"function":"handle","class":"Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler","type":"->","args":[16384,"MinLength is deprecated since version 2.1 and will be removed in 2.3.","/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MinLength.php",31,{"options":{"limit":"2","message":"fos_user.new_password.short","groups":["ChangePassword","ResetPassword"]}}]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MinLength.php","line":31,"function":"trigger_error","args":["MinLength is deprecated since version 2.1 and will be removed in 2.3.",16384]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/AbstractLoader.php","line":63,"function":"__construct","class":"Symfony\\Component\\Validator\\Constraints\\MinLength","type":"->","args":[{"limit":"2","message":"fos_user.new_password.short","groups":["ChangePassword","ResetPassword"]}]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php","line":108,"function":"newConstraint","class":"Symfony\\Component\\Validator\\Mapping\\Loader\\AbstractLoader","type":"->","args":[[],{"limit":"2","message":"fos_user.new_password.short","groups":["ChangePassword","ResetPassword"]}]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php","line":63,"function":"parseConstraints","class":"Symfony\\Component\\Validator\\Mapping\\Loader\\XmlFileLoader","type":"->","args":[{"constraint":{"option":{"value":[]}}}]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php","line":57,"function":"loadClassMetadata","class":"Symfony\\Component\\Validator\\Mapping\\Loader\\XmlFileLoader","type":"->","args":["[object] (Symfony\\Component\\Validator\\Mapping\\ClassMetadata: {\"name\":\"FOS\\\\UserBundle\\\\Form\\\\Model\\\\ChangePassword\",\"defaultGroup\":\"ChangePassword\",\"members\":[],\"properties\":[],\"getters\":[],\"groupSequence\":[],\"groupSequenceProvider\":false,\"constraints\":[],\"constraintsByGroup\":[]})"]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php","line":57,"function":"loadClassMetadata","class":"Symfony\\Component\\Validator\\Mapping\\Loader\\LoaderChain","type":"->","args":["[object] (Symfony\\Component\\Validator\\Mapping\\ClassMetadata: {\"name\":\"FOS\\\\UserBundle\\\\Form\\\\Model\\\\ChangePassword\",\"defaultGroup\":\"ChangePassword\",\"members\":[],\"properties\":[],\"getters\":[],\"groupSequence\":[],\"groupSequenceProvider\":false,\"constraints\":[],\"constraintsByGroup\":[]})"]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php","line":89,"function":"loadClassMetadata","class":"Symfony\\Component\\Validator\\Mapping\\Loader\\LoaderChain","type":"->","args":["[object] (Symfony\\Component\\Validator\\Mapping\\ClassMetadata: {\"name\":\"FOS\\\\UserBundle\\\\Form\\\\Model\\\\ChangePassword\",\"defaultGroup\":\"ChangePassword\",\"members\":[],\"properties\":[],\"getters\":[],\"groupSequence\":[],\"groupSequenceProvider\":false,\"constraints\":[],\"constraintsByGroup\":[]})"]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/ValidationVisitor.php","line":152,"function":"getMetadataFor","class":"Symfony\\Component\\Validator\\Mapping\\ClassMetadataFactory","type":"->","args":["[object] (FOS\\UserBundle\\Form\\Model\\ChangePassword: {\"new\":\"p\"})"]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/ExecutionContext.php","line":252,"function":"validate","class":"Symfony\\Component\\Validator\\ValidationVisitor","type":"->","args":["[object] (FOS\\UserBundle\\Form\\Model\\ChangePassword: {\"new\":\"p\"})","ChangePassword","data","true","false"]}]} []
[2012-12-18 16:31:33] deprecation.WARNING: MinLength is deprecated since version 2.1 and will be removed in 2.3. {"type":-100,"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MinLength.php","line":31,"stack":[{"function":"handle","class":"Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler","type":"->","args":[16384,"MinLength is deprecated since version 2.1 and will be removed in 2.3.","/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MinLength.php",31,{"options":{"limit":"2","message":"fos_user.new_password.short","groups":["ChangePassword","ResetPassword"]}}]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/MinLength.php","line":31,"function":"trigger_error","args":["MinLength is deprecated since version 2.1 and will be removed in 2.3.",16384]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/AbstractLoader.php","line":63,"function":"__construct","class":"Symfony\\Component\\Validator\\Constraints\\MinLength","type":"->","args":[{"limit":"2","message":"fos_user.new_password.short","groups":["ChangePassword","ResetPassword"]}]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php","line":108,"function":"newConstraint","class":"Symfony\\Component\\Validator\\Mapping\\Loader\\AbstractLoader","type":"->","args":[[],{"limit":"2","message":"fos_user.new_password.short","groups":["ChangePassword","ResetPassword"]}]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php","line":63,"function":"parseConstraints","class":"Symfony\\Component\\Validator\\Mapping\\Loader\\XmlFileLoader","type":"->","args":[{"constraint":{"option":{"value":[]}}}]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php","line":57,"function":"loadClassMetadata","class":"Symfony\\Component\\Validator\\Mapping\\Loader\\XmlFileLoader","type":"->","args":["[object] (Symfony\\Component\\Validator\\Mapping\\ClassMetadata: {\"name\":\"FOS\\\\UserBundle\\\\Form\\\\Model\\\\ChangePassword\",\"defaultGroup\":\"ChangePassword\",\"members\":[],\"properties\":[],\"getters\":[],\"groupSequence\":[],\"groupSequenceProvider\":false,\"constraints\":[],\"constraintsByGroup\":[]})"]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php","line":57,"function":"loadClassMetadata","class":"Symfony\\Component\\Validator\\Mapping\\Loader\\LoaderChain","type":"->","args":["[object] (Symfony\\Component\\Validator\\Mapping\\ClassMetadata: {\"name\":\"FOS\\\\UserBundle\\\\Form\\\\Model\\\\ChangePassword\",\"defaultGroup\":\"ChangePassword\",\"members\":[],\"properties\":[],\"getters\":[],\"groupSequence\":[],\"groupSequenceProvider\":false,\"constraints\":[],\"constraintsByGroup\":[]})"]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php","line":89,"function":"loadClassMetadata","class":"Symfony\\Component\\Validator\\Mapping\\Loader\\LoaderChain","type":"->","args":["[object] (Symfony\\Component\\Validator\\Mapping\\ClassMetadata: {\"name\":\"FOS\\\\UserBundle\\\\Form\\\\Model\\\\ChangePassword\",\"defaultGroup\":\"ChangePassword\",\"members\":[],\"properties\":[],\"getters\":[],\"groupSequence\":[],\"groupSequenceProvider\":false,\"constraints\":[],\"constraintsByGroup\":[]})"]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/ValidationVisitor.php","line":152,"function":"getMetadataFor","class":"Symfony\\Component\\Validator\\Mapping\\ClassMetadataFactory","type":"->","args":["[object] (FOS\\UserBundle\\Form\\Model\\ChangePassword: {\"new\":\"p\"})"]},{"file":"/mywebapp/vendor/symfony/symfony/src/Symfony/Component/Validator/ExecutionContext.php","line":252,"function":"validate","class":"Symfony\\Component\\Validator\\ValidationVisitor","type":"->","args":["[object] (FOS\\UserBundle\\Form\\Model\\ChangePassword: {\"new\":\"p\"})","ChangePassword","data","true","false"]}]} []