Closed (fixed)
Project:
Group Membership Request
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
16 Dec 2022 at 10:39 UTC
Updated:
30 Jan 2023 at 14:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
lobsterr commentedIt sounds like a good idea.
Comment #3
dxvargas commentedI'm proposing a solution now, to have a hook_content_insert() with similar code that already exists for hook_content_delete().
This will check if the entity being inserted is a group membership that matches an existing membership request for the same user and group, in that case it will delete the membership request.
Then I refactored a bit, to not duplicate code.
Comment #4
lobsterr commented@dxvargas, I don't see in your patch the solution, what you described for this ticket. I will work on the solution
Comment #5
dxvargas commented@LOBsTerr did you test it?
With the solution I've proposed, the membership request is deleted once a group admin adds the user to the group. I've tested the steps I've described, after applying the patch, and the record is not visible (step #3).
Anyway, any other solution is welcome. Thanks for the feedback.
Comment #6
lobsterr commented@dxvargas ops, I see now :), but still it requires some improvements.
For the current moment, what would happen we will approve a request, and then we create a membership group content, which will delete group membership request. I think we need to check the status field and we want to be sure that it is not approved yet.
Comment #8
lobsterr commented@dxvargas, I have used your patch and extended it. A group membership request will be removed, if a new group membership was created outside grequest module. For that we check that status of group membership request is still pending. I did a small refactoring and also updated tests accordingly. Please check it and I will tag a new version.
Comment #9
lobsterr commentedComment #10
dxvargas commented@LOBsTerr, I'm ok with checking the status. I've tested your MR !21, it works as expected. I also agree with the small improvements and the tests changes (both removing testRequestWithMemberAsUser and the new testGroupMembershipInsertion).
I mark this issue as RTBC.
Comment #12
lobsterr commentedThank you for your review!