Cannot remove recurring instance

Created on 10 May 2023, over 1 year ago
Updated 11 March 2024, 9 months ago

When trying to remove a recurring event an AJAX 500 error pops up and instance is not removed. Error log is as follows:

Drupal\Core\Entity\Query\QueryException: Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck(). in Drupal\Core\Entity\Query\Sql\Query->prepare() (line 141 of /var/www/html/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

Steps to reproduce:

  • Create a piece of content with smart date field
  • Add a recurring time frame
  • Save content type
  • Edit content type and click to manage instances
  • Click to remove instance
  • Error will happen

I tried looking around to find where this query was to add the accessCheck(TRUE) but so far I have been unable to find the instance of this happening anywhere.

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @catapipper
  • First commit to issue fork.
  • @mandclu opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡¨πŸ‡¦Canada mandclu

    Thanks for identifying this. It looks the the access check was needed in SmartDateRemoveInstanceForm.php. Please confirm that this resolves the problem for you as well.

  • Looks like it works for me. Thanks for much!

  • Status changed to RTBC over 1 year ago
  • Status changed to Fixed over 1 year ago
  • πŸ‡¨πŸ‡¦Canada mandclu

    Great! This change has been merged.

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

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States joegraduate Arizona, USA
  • πŸ‡ΈπŸ‡ͺSweden carolalind Nybro

    I'm getting an error still on my site when trying to remove recurring instances. The error is "The was a problem with your form submission" but it doesn't happen with the admin role, only with the editor role.

    I have granted access for editor on these :

    • Cancel Smart Date Recur instances,
    • Make Smart Dates recur,
    • Reschedule Smart Date Recur instances.

    What am I missing?

    When I inspect with console it shows an ajax error.

  • πŸ‡¨πŸ‡¦Canada mandclu

    @carolalind were any errors logged? It sounds like it should be something permissions-related.

  • πŸ‡ΈπŸ‡ͺSweden carolalind Nybro

    @mandclu no nothing in the log at all. When I'm logged in as editor and click remove instance the text is not crossed over and if i try to save the node the error "There was a problem with your form submission" shows up. The node itself is registered in log as updated but the date isn't removed.

    I also think it might be something related to permissions, but I can't figure out what. Everything connected to smart date and the booking nodetype have permissions correctly set as far as i can see.

    It would be easier to locate if there was something logged when this happens.

    Feeling a little lost here on how to proceed.

  • πŸ‡ΈπŸ‡ͺSweden carolalind Nybro

    @mandclu now I've checked every permission there is on my site and I finally found the one that broke the manage instances function. If I check the "Bypass Honeypot protection" permission for the editor role it works as designed. Must be a Honeypot problem then I guess???

  • Giving the severity of the bug, I believe this patch should probably be added to 3.7.x or 3.7.x be deprecated.

Production build 0.71.5 2024