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

Empty trash operations don't entirely delete users in trash

    Details

    • Type: Bug Bug
    • Status: Specification Review
    • Priority: High High
    • Resolution: Unresolved
    • Affects Version/s: dev-master
    • Fix Version/s: None
    • Labels:
      None

      Description

      As opposite to what legacy admin did, in Platform Ui it's possible to send users to the trash.
      Once you do it you may want to empty the trash completely and this will try to delete all contents in the trash.

      But when one of this contents in trash is a user, user entry still remains in ezuser table and this became a huge problem.
      first, loadUserByLogin and loadUsersByEmail method in UserService will still get those entries from the ezuser table, but as ezcontentobject related record has indeed be delated, a content not found exception will be thrown

      Second, you can't use that login for a new possible user anymore, even if theorically was deleted.

      So, as spoken with Bertrand, we have some possible solutions|actions need to be made

      • fix in PlatformUI (the button should call delete, not trash, when in user section)
      • Alternative would be to override the TrashController as well.
      • create a cleanup script for people that may have used this option in the past
      • tweak content/trash api so they refuse to delete users until we have a better solution for this

      Here's a screencast. sorry for the noise, didn't know microphone was on
      https://www.youtube.com/watch?v=VHcbYcQhTrA

        Issue Links

          Activity

          Hide
          Bertrand Dunogier added a comment -

          This (wrong) behaviour is a limitation of EZP-25024. REST operations on /content are proxied, and when they affect a user, executed with the user API instead of the content one. The Trash API isn't overridden, and therefore User content items are deleted, leading to leftovers in external data (there is no external storage for the User FieldType). *But* the content API override does handle deletion.

          As said by Carlos, the first thing to do is change the delete button in the user section so that it says "Delete", not "Send to trash", and does a DELETE on the content item. It should work with the proxy.

          Data that got broken needs to be fixed, probably with a script (cleanup entries in ezuser that don't match any content). Trashed users should also be removed, as they can't be restored.

          I suggest we create sub-tasks for handling those steps, what do you think Carlos ?

          Show
          Bertrand Dunogier added a comment - This (wrong) behaviour is a limitation of EZP-25024 . REST operations on /content are proxied, and when they affect a user, executed with the user API instead of the content one. The Trash API isn't overridden, and therefore User content items are deleted, leading to leftovers in external data (there is no external storage for the User FieldType). * But * the content API override does handle deletion. As said by Carlos, the first thing to do is change the delete button in the user section so that it says "Delete", not "Send to trash", and does a DELETE on the content item. It should work with the proxy. Data that got broken needs to be fixed, probably with a script (cleanup entries in ezuser that don't match any content). Trashed users should also be removed, as they can't be restored. I suggest we create sub-tasks for handling those steps, what do you think Carlos ?
          Hide
          Carlos Revillo added a comment -

          ok the the sub-tasks

          Show
          Carlos Revillo added a comment - ok the the sub-tasks
          Hide
          Bertrand Dunogier added a comment -

          Created 2 sub-tasks, and assigned them to you as a reporter. You may be able to edit them.

          Show
          Bertrand Dunogier added a comment - Created 2 sub-tasks, and assigned them to you as a reporter. You may be able to edit them.
          Hide
          Carlos Revillo added a comment -

          Thanks. Could we maybe another one for the cleanup script for the db tables?

          Show
          Carlos Revillo added a comment - Thanks. Could we maybe another one for the cleanup script for the db tables?
          Hide
          Bertrand Dunogier added a comment -

          Done, you can edit.

          Show
          Bertrand Dunogier added a comment - Done, you can edit.
          Hide
          Carlos Revillo added a comment -

          thanks, edited

          Show
          Carlos Revillo added a comment - thanks, edited

            People

            • Assignee:
              Carlos Revillo
              Reporter:
              Carlos Revillo
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: