Score:0

Editing media for content editor results in a 404

ve flag

We have a custom role, location_editor, which is assigned to users who can only manage media and one content type.

These are the role's media permissions.

screenshot

And if the user now tries to enter any valid media edit url (for example /media/35/edit - which does exist and was created by him), the result is a 404. The admin user can edit it just fine. The user can also access /media/35/delete without problems.

I tried to debug the stack already, and for example the MediaAccessHandler is correctly called and returns a accessAllowed().

Is there any right I might miss in the configuration?

Is there a good way to debug this, to find the reason why Drupal considers this a 404 error for this specific role?

Score:0
ve flag

My colleague managed to find the solution by great intuition (aka "pure luck"). It turned out, that our additional module Rabit Hole is causing side effects here:

enter image description here

Enabling "Bypass Rabbit Hole for Media" for the location_editor role solved the issue.

His debugging skills are noteworthy thou:

  1. he checked issues on drupal.org and as there was nothing about 404 on edit he assumed that it must be something on our side
  2. the code was actually clean
  3. it must be something funny, probably a side effect of a contrib module
  4. he checked the composer.json for unusual modules that might have something to do with access check -> bingo :)

Many thx!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.