Steps to reproduce issue with Content Access 7.x-1.x-dev (2011-Dec-01):

  1. Create an image style for displaying uploaded images on nodes (eg scale and crop).
  2. Create (or modify) content type to have an image field and set display for that field to use the defined image style.
  3. Set the Upload Destination for the image field on the content type to be Private Files.
  4. Create a new "test" user with a role which grants access to create/edit/delete this content type.
  5. Log in as the new user and create a new node of this content type. Upload an image and save the node. Note that the image displays correctly (using the defined style) whether the node is published or not.
  6. Install Content Access, rebuild permissions, configure the content type to grant permission to the "test" user to view any, view own, edit any, edit own, delete any, delete own (ie give the user full rights over that content type).
  7. Log in as the test user again, create a new node of the content type, upload an image. Note that the thumbnail image style is generated correctly on upload, leave the node UNPUBLISHED and save it.
  8. This time the image is not displayed on the node. The image style for it is not generated so the image displays as broken on the browser page.
  9. Edit the node and change it to PUBLISHED and save again. This time the image does display correctly on the node.

This problem only occurs if the image field uses the private file system AND the node is unpublished. If the file system is public, or if the node is published, the image style is generated and displays correctly.

On saving the unpublished node two errors are logged to dblog:

Type access denied
Location http://[domain]/system/files/styles/gallery_thumb/private/photos/2012-06/IMG_0638.jpg
Referrer http://[domain]/photos/test-2
Message system/files/styles/gallery_thumb/private/photos/2012-06/IMG_0638.jpg

Type php
Location http://[domain]/system/files/styles/gallery_thumb/private/photos/2012-06/IMG_0638.jpg
Referrer http://[domain]/photos/test-2
Message Warning: Cannot modify header information - headers already sent by (output started at [drupal-path]/includes/common.inc:2608) in drupal_send_headers() (line 1243 of [drupal-path]/includes/bootstrap.inc).

Note that the image does upload correctly to the designated folder and that the thumbnail image style (for display on the edit page) IS generated. But not the image style for display on the node.

Also, this only happens if the node is created by a user who is not User 1. If User 1 creates the node the image style is always created correctly.

I've checked these steps on a completely clean Drupal install and had exactly the same problem.

Any suggestions or help would be appreciated. Thanks!

Comments

gisle’s picture

Status: Active » Closed (outdated)

This issue has not received any updates in the previous 7 years. If you believe it to still be relevant, you are encouraged to reopen the issue and update it.

If you got an email about this Issue status update, it is because you at one time (possibly a very long time ago), subscribed to it. To learn how to unsubscribe yourself, please visit: https://www.drupal.org/project/webmasters/issues/3142987