This issue is caused by a user trying to select a image that is used in a node that they don't have access to due to it being unpublished. What appears to be happening is since the content type the user does not have access to is having is access checked first, it is breaking out of the foreach for all content types, not just the loop checking revisions.

Changing the break from 2 to 1 will stop it from checking other revisions, but still allow it to check other node types.

Members fund testing for the Drupal project. Drupal Association Learn more


theonetruedevo’s picture

Issue summary: View changes
eewan’s picture

This bug manifests itself in different ways.

To be pedantic the bug is not really related to different content types. You can have two nodes of the same content type both of which reference the same file, and if one of the two nodes is unpublished you have the problem.

The outer foreach loops over field types, the inner foreach loops over revisions. This means that a break 1 will not always suffice.

I suggest removing the break entirely.