Skip to content

Able to assign group admin to unexisting group #5868

Closed

Description

@PVince81

Steps to reproduce

  1. Go to the users page
  2. In the controls bar behind the password field, click the "Groups" dropdown
  3. Click "+ add group"
  4. Type in "unexist"
  5. Close the dropdown, do NOT click "Create".
  6. In the user list, assign a user to the group "unexist"
  7. Refresh the page

Expected result

At step 6, the non-existing group should not happen yet in the "Group admin" dropdown of the users list.

Actual result

Possible to select the not existing group.
After refresh the dropdown appears empty because it tries to select a value that it not in the dropdown.
The database table oc_group_admin has an entry with the non-existing group.

Versions

OC 6 beta 4

This is not a showstopper, as it doesn't break much.
It is still possible to create group admins.

Is there a reason why we're not using foreign keys to prevent such cases, maybe database compatibility ? @DeepDiver1975

Activity

  1. PVince81 commented on Nov 14, 2013

    @PVince81
    ContributorAuthor

    Setting to OC7 as it's not a showstopper.

  2. DeepDiver1975 commented on Nov 15, 2013

    @DeepDiver1975
    Contributor

    Is there a reason why we're not using foreign keys to prevent such cases, maybe database compatibility ?

    My evil me wants to answer: some devs have no clue about proper database design 👿

    But at the end it comes down to the broad support of databases - e.g. MySQL engine MyISAM has no clue about foreign keys

  3. tigran-a commented on Dec 9, 2013

    @tigran-a

    BTW, wouldn't it be better to add integer autoincrement ID field to the users and groups tables ?
    (since these fields are used in other tables, that would be more "academic" I guess, otherwise the space is wasted for storing multiple copies of arbitrary strings). However it might require some code rewriting...

  4. modified the milestones: , on Sep 2, 2014
  5. modified the milestones: , on Jan 9, 2015
  6. DeepDiver1975 commented on Jan 9, 2015

    @DeepDiver1975
    Contributor

    @MorrisJobke please have a look once you work on user management for 8.1 - THX

  7. PVince81 commented on Feb 4, 2015

    @PVince81
    ContributorAuthor

    or @LukasReschke.

    I haven't retried in 8.0 yet

  8. modified the milestones: , on Apr 4, 2015
  9. PVince81 commented on Aug 17, 2015

    @PVince81
    ContributorAuthor

    Still happening on master (8.2 pre-alpha)

  10. ghost added this to the milestone on Sep 9, 2015
  11. ghost removed this from the milestone on Sep 9, 2015
  12. rullzer commented on Dec 22, 2015

    @rullzer
    Contributor

    I can't reprodce this anymore. The user page does not even shot the bug anymore and the subadmin stuff should not also properly handle this.

    @PVince81 please confirm and close ;)

  13. PVince81 commented on Dec 23, 2015

    @PVince81
    ContributorAuthor

    Works fine now on master 1b36987 / 9.0 pre-alpha

  14. lock commented on Aug 7, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  15. locked as resolved and limited conversation to collaborators on Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions