Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-25112

Creating an User with <mail>@<domain> passes field validation but raises an error when publishing

    Details

    • Type: Bug Bug
    • Status: Confirmed
    • Priority: High High
    • Resolution: Unresolved
    • Affects Version/s: 2015.09.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.7.2, 1.9.0-rc
    • Fix Version/s: QA tracked issues
    • Environment:

      Operating System: CentOS 7.0 x64
      PHP Version: 5.4.16
      Database and version: Mariadb 5.5
      Browser (and version): Firefox 42

      Description

      This issue is similar to EZP-24962, but concerning email used when creating users.

      Steps to reproduce:

      • Create a new user. Fill in all fields, except email field (don't publish it).
      • On the email field, fill in with "name@domain". When exiting the field, no validation error is shown
      • Publish the user
        When publishing, a An error occured while publishing the draft notification is presented.

        Issue Links

          Activity

          Hide
          André Rømcke added a comment -

          So UI should probably be able to handle other error codes that won't contain validation errors, however as for mapping this to the server field validations it is perhaps more of a task to to in API. However in current design it won't be able to collect all validation errors across user validations (in UserService) and the actually field validations (ContentService), but at least it can be made to give the right response what UI can use.

          Show
          André Rømcke added a comment - So UI should probably be able to handle other error codes that won't contain validation errors, however as for mapping this to the server field validations it is perhaps more of a task to to in API. However in current design it won't be able to collect all validation errors across user validations (in UserService) and the actually field validations (ContentService), but at least it can be made to give the right response what UI can use.
          Hide
          Bertrand Dunogier added a comment - - edited

          We do have a limitation on the server side.

          The Proxy we have created to allow creation of users using the content REST API does not convert errors from the User Service on user account properties to ContentFieldValidationException. PlatformUI is then unable to map the errors back to the user account field.

          Doing so wouldn't be very clean (e.g. catch InvalidArgumentValue exceptions, and generate the expected one from there), but it is nonetheless doable, if we are willing to prioritize this.

          Show
          Bertrand Dunogier added a comment - - edited We do have a limitation on the server side. The Proxy we have created to allow creation of users using the content REST API does not convert errors from the User Service on user account properties to ContentFieldValidationException. PlatformUI is then unable to map the errors back to the user account field. Doing so wouldn't be very clean (e.g. catch InvalidArgumentValue exceptions, and generate the expected one from there), but it is nonetheless doable, if we are willing to prioritize this.
          Hide
          Damien Pobel (Inactive) added a comment -

          Ah Then we have a new bug on top of this one caused by EZP-26240 and also that means the fix for EZP-24853 was incomplete.

          Show
          Damien Pobel (Inactive) added a comment - Ah Then we have a new bug on top of this one caused by EZP-26240 and also that means the fix for EZP-24853 was incomplete.
          Hide
          Paulo Nunes (Inactive) added a comment -

          [~damien.pobel@ez.no], both in master as in 1.6.0-beta, after publishing, I have an infinite spinning well.
          In dev tools I have

          "NetworkError: 406 Not Acceptable - http://ezp60.local/api/ezp/v2/content/objects"
          typeError: response.document.ErrorMessage.errorDetails is undefined
          Y.eZ.DraftServerSideValidation<._parseServerFieldsErrors()
           _ezcombo:1248
          Y.eZ.Plugin.PublishDraft<._createPublishContent/<()
           _ezcombo:1665
          e.bind/<()
           _ezcombo:8
          e.Model<.save/</<()
           _ezcombo:121
          Y.eZ.Content<._createContent/<()
           _ezcombo:2214
          XmlHttpRequestConnection.prototype.execute/XHR.onreadystatechange()
           _ezcombo:1580
          

          With response

          {"ErrorMessage":{"_media-type":"application\/vnd.ez.api.ErrorMessage+json","errorCode":406,"errorMessage"
          :"Not Acceptable","errorDescription":"Argument 'email' is invalid: 'one@one' is wrong value in class
           'UserCreateStruct'"}}
          

          Is I use "<mail>@<domain>.com", then no problem occurs

          Show
          Paulo Nunes (Inactive) added a comment - [~damien.pobel@ez.no] , both in master as in 1.6.0-beta, after publishing, I have an infinite spinning well. In dev tools I have "NetworkError: 406 Not Acceptable - http://ezp60.local/api/ezp/v2/content/objects" typeError: response.document.ErrorMessage.errorDetails is undefined Y.eZ.DraftServerSideValidation<._parseServerFieldsErrors() _ezcombo:1248 Y.eZ.Plugin.PublishDraft<._createPublishContent/<() _ezcombo:1665 e.bind/<() _ezcombo:8 e.Model<.save/</<() _ezcombo:121 Y.eZ.Content<._createContent/<() _ezcombo:2214 XmlHttpRequestConnection.prototype.execute/XHR.onreadystatechange() _ezcombo:1580 With response {"ErrorMessage":{"_media-type":"application\/vnd.ez.api.ErrorMessage+json","errorCode":406,"errorMessage" :"Not Acceptable","errorDescription":"Argument 'email' is invalid: 'one@one' is wrong value in class 'UserCreateStruct'"}} Is I use "<mail>@<domain>.com", then no problem occurs
          Hide
          Damien Pobel (Inactive) added a comment -

          With EZP-26240 implemented, this should not be a problem any more, Paulo Nunes can you retest please ?

          Show
          Damien Pobel (Inactive) added a comment - With EZP-26240 implemented, this should not be a problem any more, Paulo Nunes can you retest please ?

            People

            • Assignee:
              Unassigned
              Reporter:
              Paulo Nunes (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: