Improve invalid value messages
Improve invalid value messages
The message returned by msgPool::invalid is often wrong, because StringAttribute sends it the regex for complete valid value while it expects the regex for individual valid characters.
Link issues together to show that they're related. Learn more.
Activity
- bmortier changed milestone to %FusionDirectory 1.4
changed milestone to %FusionDirectory 1.4
By Côme Chilliet on 2019-10-31T09:07:07 (imported from GitLab)
- bmortier added PJ1802-0188 label
added PJ1802-0188 label
- bmortier changed the description
changed the description
By Côme Chilliet on 2019-10-31T09:08:40 (imported from GitLab)
- bmortier mentioned in merge request !706
mentioned in merge request !706
By Côme Chilliet on 2019-10-31T09:09:27 (imported from GitLab)
- bmortier created merge request !706 to address this issue
created merge request !706 to address this issue
By Côme Chilliet on 2019-10-31T09:09:27 (imported from GitLab)
- bmortier added 1h of time spent at 2019-10-31
added 1h of time spent at 2019-10-31
By Côme Chilliet on 2019-10-31T10:52:18 (imported from GitLab)
- bmortier added To Be Tested label
added To Be Tested label
- bmortier assigned to @jswaelens and unassigned @MCMic
assigned to @jswaelens and unassigned @MCMic
By Côme Chilliet on 2019-10-31T10:52:18 (imported from GitLab)
Got this while testing something else:
<b>Fatal error</b>: Uncaught TypeError: Argument 2 passed to msgPool::invalid() must be of the type string, null given, called in /usr/share/fusiondirectory/include/simpleplugin/attributes/class_IntAttribute.inc on line 83 and defined in /usr/share/fusiondirectory/include/class_msgPool.inc:429 Stack trace: #0 /usr/share/fusiondirectory/include/simpleplugin/attributes/class_IntAttribute.inc(83): msgPool::invalid('Group id', NULL, 'An integer larg...') #1 /usr/share/fusiondirectory/include/simpleplugin/class_simplePlugin.inc(1554): IntAttribute->check() #2 /usr/share/fusiondirectory/plugins/personal/posix/class_posixAccount.inc(371): simplePlugin->check() #3 /usr/share/fusiondirectory/include/simpleplugin/class_simpleTabs.inc(354): posixAccount->check() #4 /usr/share/fusiondirectory/include/simpleplugin/class_simpleTabs.inc(378): simpleTabs->check() #5 /usr/share/fusiondirectory/include/simpleplugin/class_simplePlugin.inc(1809): simpleTabs->save() #6 /usr/share/fusiondirectory/include/simpleplugin/class_simplePlugin.inc(1596): sim in <b>/usr/share/fusiondirectory/include/class_msgPool.inc</b> on line <b>429</b><br />
By Côme Chilliet on 2019-11-05T09:44:58 (imported from GitLab)
- bmortier assigned to @MCMic and unassigned @jswaelens
assigned to @MCMic and unassigned @jswaelens
By Côme Chilliet on 2019-11-05T09:45:10 (imported from GitLab)
- bmortier mentioned in merge request !707
mentioned in merge request !707
By Côme Chilliet on 2019-11-05T10:07:59 (imported from GitLab)
- bmortier created merge request !707 to address this issue
created merge request !707 to address this issue
By Côme Chilliet on 2019-11-05T10:07:59 (imported from GitLab)
- bmortier added 1h of time spent at 2019-11-05
added 1h of time spent at 2019-11-05
By Côme Chilliet on 2019-11-05T10:31:51 (imported from GitLab)
- bmortier assigned to @jswaelens and unassigned @MCMic
assigned to @jswaelens and unassigned @MCMic
By Côme Chilliet on 2019-11-05T10:31:51 (imported from GitLab)
I did few testing with the webservice and it look pretty much ok.
Maybe only the date error that could be more clear
$ C /objects/user/uid=fd-admin,ou=people,dc=nodomain/mailAccount/mail -X PUT --data '"testsansatdansmail"' [ { "message": "The field \"Primary address\" contains an invalid value.<br/><br/> \"testsansatdansmail\"", "line": 44, "file": "/usr/share/fusiondirectory/include/webservice/class_fdRPCService.inc" } ] $ C /objects/user/uid=fd-admin,ou=people,dc=nodomain/personalInfo/dateOfBirth -X PUT --data '"testsansatdansmail"' [ { "message": "Error, incorrect date: DateTime::__construct(): Failed to parse time string (testsansatdansmail) at position 0 (t): The timezone could not be found in the database", "line": 44, "file": "/usr/share/fusiondirectory/include/webservice/class_fdRPCService.inc" } ] $ C /objects/user/uid=fd-admin,ou=people,dc=nodomain/personalInfo/dateOfBirth -X PUT --data '1' [ { "message": "Error, incorrect date: DateTime::__construct(): Failed to parse time string (1) at position 0 (1): Unexpected character", "line": 44, "file": "/usr/share/fusiondirectory/include/webservice/class_fdRPCService.inc" } ] $ C /objects/user/uid=fd-admin,ou=people,dc=nodomain/personalInfo/dateOfBirth -X PUT --data '"1"' [ { "message": "Error, incorrect date: DateTime::__construct(): Failed to parse time string (1) at position 0 (1): Unexpected character", "line": 44, "file": "/usr/share/fusiondirectory/include/webservice/class_fdRPCService.inc" } ] $ C /objects/user/uid=fd-admin,ou=people,dc=nodomain/posixAccount/shadowMax -X PUT --data '"-1"' [ { "message": "The field \"Delay before forcing password change (days)\" contains an invalid value.<br/><br/> \"-1\"<br/><br/><i>Example: An integer larger than 0</i> ", "line": 44, "file": "/usr/share/fusiondirectory/include/webservice/class_fdRPCService.inc" } ] $ C /objects/user/uid=fd-admin,ou=people,dc=nodomain/posixAccount/shadowMax -X PUT --data '"test"' [ { "message": "The field \"Delay before forcing password change (days)\" contains an invalid value.<br/><br/> \"test\"<br/><br/><i>Example: An integer larger than 0</i> ", "line": 44, "file": "/usr/share/fusiondirectory/include/webservice/class_fdRPCService.inc" } ]
By Jonathan Swaelens on 2019-12-05T14:51:51 (imported from GitLab)
- bmortier added 1h of time spent at 2019-12-05
added 1h of time spent at 2019-12-05
By Jonathan Swaelens on 2019-12-05T14:51:51 (imported from GitLab)
- bmortier removed To Be Tested label
removed To Be Tested label