If the anonymous user doesn't have permissions to create a product review the link returns a 403. It would be best if there was a message inviting the user to log in.
If the anonymous user doesn't have permissions to create a product review the link returns a 403. It would be best if there was a message inviting the user to log in.
Comments
Comment #2
alexandersluiter commentedIf you swap the '#url' array item out in OverallRatingStarsFormatter.php aroudn line 216 with the following, you won't get 403's anymore and it will forward already-logged-in users to the review page just fine.
Url::fromRoute('user.login', [], ['query' => ['destination' => Url::fromRoute('entity.commerce_product.review_form', ['commerce_product' => $product->id()])->toString()]]),We have a bunch of custom patches to this module, I can write a patch for just this if you'd like.
Comment #3
agoradesign commentedsounds reasonable. Yes, a patch would be great. This module is not in my scope at the moment, but with a ready patch, I can review and commit it, if it's ok.
Although the login link is redirecting already logged in users, it wouldn't hurt to do an additonal check... I'd prefer first create the url to review, as we need this anyway. Then check for anonymous user and within that if create the login url and re-use the first url object in the destination parameter.
Comment #5
agoradesign commented