Skip to content

Error when server side validation finds an error #711

Description

@christinaboehme

Bit of a special scenario, please let me explain:

I have a registration form, username equals the e-mail address, so it only asks for the username. I also have a user in the database, in which username and e-mail are not equal. Lets say the username is test1, the e-mail is test2. When I now try to register a user with test2, the frontend validation is all fine, since the username is not taken. The server side validation then finds an issue, because of course as an e-mail, test2 IS indeed taken.

That's where I get an exception from femanager:

Cannot use object of type TYPO3\CMS\Extbase|Validation\Error as array

I suppose this is a remnant of an upgrade of sorts. The fix is in fact very simple, just change line 37 in Classes/Domain/Service/ValidationService.php where it says $error['message'] to $error->getMessage(). Or use the patch.

ErrorMessage.patch

Thanks for a great extension!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions