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

Updating a role to the same name raises a notification error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: High High
    • Resolution: Fixed
    • Affects Version/s: QA tracked issues, 2015.09.1
    • Fix Version/s: 2015.11
    • Environment:

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

      Description

      When we try to update the name of a Role, mantaining the same name, a notification error is raised:

      Form did not validate. Please review errors below.
      

      and the information below is presented

      Identifier "Anonymous" already exists. Role identifier must be unique.
      

      Steps to reproduce
      • Access the roles page
      • Edit the "Anonymous" role
      • Without changing anything, click the "save" button

        Activity

        Hide
        Gunnstein Lye added a comment -

        Confirmed, I get: Argument '$roleUpdateStruct' is invalid: Role '6' with the specified identifier 'Subscriber' already exists

        Show
        Gunnstein Lye added a comment - Confirmed, I get: Argument '$roleUpdateStruct' is invalid: Role '6' with the specified identifier 'Subscriber' already exists
        Hide
        Gunnstein Lye added a comment - - edited

        Now that role drafts have different ID from the published role, I think we need to expose ezrole.version (a.k.a. original_id):
        RoleService::updateRoleDraft() : if ($existingRole->id != $loadedRoleDraft->version) should do the trick when detecting duplicates.

        Edit: This was not needed, used the SPI instead.

        Show
        Gunnstein Lye added a comment - - edited Now that role drafts have different ID from the published role, I think we need to expose ezrole.version (a.k.a. original_id): RoleService::updateRoleDraft() : if ($existingRole->id != $loadedRoleDraft->version) should do the trick when detecting duplicates. Edit: This was not needed, used the SPI instead.
        Show
        Gunnstein Lye added a comment - PR: https://github.com/ezsystems/ezpublish-kernel/pull/1484
        Show
        Gunnstein Lye added a comment - Merged in master: https://github.com/ezsystems/ezpublish-kernel/commit/971990b33d7e4a71b5353d4503695a316ee0128f
        Hide
        Paulo Nunes (Inactive) added a comment -

        QA Approved

        Show
        Paulo Nunes (Inactive) added a comment - QA Approved

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 3 hours, 30 minutes
              3h 30m