anonymous cannot create notifications although /permissions allow it?

Created on 26 May 2021, about 3 years ago
Updated 14 June 2024, 13 days ago

Hi, I enabled "Create commerce stock notifications" for anonymous and authenticated users on the /admin/people/permissions
but when I try to subscribe for a notification I get the error message "You must be authenticated to do that".
I can only subscribe successfully when authenticated.

So how do I enable notifications subscribing for anonymous?

🐛 Bug report
Status

Fixed

Version

1.0

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States Delty

    It might be worth checking out how Simplenews handles unsubscribe requests for anonymous users since the use case is almost identical.

    Thanks,

    -=Delty

  • 🇺🇸United States jcmartinez Raleigh, NC, USA

    This module probably worked for a very specific use case, but it isn't useful for a general ecommerce site, unless this problem is solved.

    It was very close to what I needed.

  • @jcmartinez opened merge request.
  • 🇺🇸United States jcmartinez Raleigh, NC, USA

    I just created an Issue Fork with a fix that looks into permissions to allow (or not) anonymous users to create notifications. Off course, this will depend on the permission to be granted by you to the anonymous role.

    It works for me on the Dev version of this module.

    You can use composer to apply a patch from the plain diff link under the Issue Fork.

    Remeber that if you allow anonymous users to subscribe, then you will be in charge of unsubscribing them because they can't do it by themselves.

  • 🇨🇭Switzerland Lukas von Blarer

    There is another issue regarding this: Proposed new features patch - allow anonymous, unsubscribe if duplicate Closed: duplicate

  • 🇵🇹Portugal introfini

    The patch works. Thanks!

  • 🇺🇸United States jcmartinez Raleigh, NC, USA

    This patch is a remake of my previous patch, to be used after applying two other patches that will bring this module to compatibility with Drupal 10.

    Add the following three patches to the patches section of your composer.json file to solve the current issue and to add compatibility to Drupal 10:

            "patches": {
                "drupal/commerce_stock_notifications": {
                    "Drupal 10 compatibility": "https://git.drupalcode.org/project/commerce_stock_notifications/-/merge_requests/11.diff",
                    "Drupal 10 compatibility Continued": "https://git.drupalcode.org/project/commerce_stock_notifications/-/merge_requests/14.diff",
                    "Allow anonymous create notifications": "https://www.drupal.org/files/issues/2023-11-11/3215770-D10-anonymous-notifications.patch"
                }
            }
    

    When the patches that add compatibility to this module are merged, we should be able to use this patch alone to solve the current issue under Drupal 10.

  • 🇺🇸United States jcmartinez Raleigh, NC, USA
  • Status changed to Needs work 2 months ago
  • 🇸🇰Slovakia poker10

    Thanks for working on this. I have added some comments to the MR.

  • 🇸🇰Slovakia poker10

    I have moved this to a bug, because we have a permission create commerce stock notification, but it is not used at all.

  • Status changed to Fixed 27 days ago
  • 🇸🇰Slovakia poker10

    Committed and pushed this. Thanks everyone!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024