Skip to content

Commit

Permalink
fix: pro_moderator_owner not stored for the admin/moderator user thro…
Browse files Browse the repository at this point in the history
…ugh org/[orgid] facet (#10560)

Pro moderator and admins experienced issues with the org/[orgid] facet in the url. The feature that allows them to navigate and act as they are part of the org is not properly working.
  • Loading branch information
4nt0ineB authored Jul 17, 2024
1 parent 3f3196e commit e0441c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ProductOpener/Routing.pm
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,10 @@ sub org_route($request_ref, @components) {
if ($orgid ne $Owner_id) {
$log->debug("checking edit owner", {orgid => $orgid, ownerid => $Owner_id}) if $log->is_debug();
my @errors = ();
my $moderator;
if ($request_ref->{admin} or $User{pro_moderator}) {
ProductOpener::Users::check_edit_owner(\%User, \@errors, $orgid);
$moderator = retrieve_user($request_ref->{user_id});
ProductOpener::Users::check_edit_owner($moderator, \@errors, $orgid);
}
else {
$request_ref->{status_code} = 404;
Expand All @@ -266,6 +268,8 @@ sub org_route($request_ref, @components) {
}
if (scalar @errors eq 0) {
set_owner_id();
# will save the pro_moderator_owner field
store_user($moderator);
}
else {
$request_ref->{status_code} = 404;
Expand Down

0 comments on commit e0441c6

Please sign in to comment.