I'm trying to make the download link in Lightbox2 available. I'm using Lightbox2 6.x 1.9, which has an option in the Layout settings that's called "Text for original image link". This is the text that will appear as the link to the original file underneath the image in the lightbox.

I want to enable this text so users can download the images displayed through Fastgallery by clicking the download link in Lightbox. Therefore I typed "Download file" in the option in lightbox, without any result. The link is not shown. I read all the documentation from bot Fastgallery and Lightbox but I can't find an answer. Can you help me to find a way to make downloads possible from the lightbox window?

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stella’s picture

Have you checked the user permissions? Users will need the 'download original image' permission in order for the link to appear.

Having said that, the download original link was intended for use with images uploaded using the 'image' module or the 'imagefield' module, and may not work with Fastgallery images. For those images, it is the fastgallery module that provides the integration iirc, so if correcting the permissions doesn't help, you may need to move this issue to the fastgallery module issue queue.

Cheers,
Stella

KoCo’s picture

Maybe, it's a bit of topic here.

I had the same problem even with permission set to downloadable.

It was in fact another permission which was also needed:
"Imagefield Module" -> "view imagefield uploads"

Maybe fastgallery also has such a permission to set?

Koen

kuakuak’s picture

I have the same problem with imagefield. I'm using the last stable (when possible) versions of everything...
Permission to download original image is granted for all users but the link is only showing to administrator. So I guess some other permission is needed?

KoCo’s picture

The problem has risen again.

My former adjustments (#2) worked just fine, until I updated to the latest version of filefield.
Then I discovered the access setting had changed too.

http://drupal.org/cvs?commit=200054

Imagefield switched over to using content_access module.
So installed that one, but no go.

Where and how does Lightbox set the rights to download the original?

line 706 module.inc : if (user_access('download original image') && user_access('view original images')) {

I searched my modules and database. This line is the only reference to the permission I could find.
I believe the old imagefield 'view uploads' or 'image' module use this permission.
But I don't have the image module installed.

Another possible wrong-do'er:

line 187 formatter.inc: if (!empty($download_link_text) && user_access('download original image') && user_access('view imagefield uploads')) {

This one is plain obvious 'view imagefield uploads' doesn't exist any more.

Shouldn't lightbox check permissions in a different way, or at least make sure a certain permission can exist/does exist?
I guess only two/three checks are needed:
_ permission to access the content
_ public files folder
_ download original image

Koen

keesje’s picture

Issue confirmed, subscribing

dicreat’s picture

subscribing

iaminawe’s picture

Issue confirmed, "Download original image" appears only to administrator regardless of permissions settings

vordude’s picture

Honestly untested, but Here's the way I see it...Line 706 of the dev version of the 6.x module.

 if (user_access('download original image') && user_access('view original images')) {

The lightbox module isn't supplying the 'view original images' permission. So your users can't see the download link do it, because you can't assign the permission to a role, since it's not on your permissions listing at /admin/user/permissions. I think this must be a permission that comes from the image.module.

So requiring this permission for the download link essentially creates a dependency on the image.module for the download link to work...

The fix?
As I see it:

  • Add 'view original images' to this module's hook_perm (creates a redundant permission that might make image.module users not work the way they expect) but works for imagefield users.
  • Remove the 'view original images' permission requirement in the above line. (creates a bypass for image.module users, who might expect their users to not be able to see the orig image, yet they can stop that by not allowing the 'download original images' permission, so also redundant and kinda clunky)
  • Check for the image.module (if in fact that's where that permission comes from) before saying && user_access('view original images')

I'm happy to roll a patch, but need to test first, and was looking for some feedback.

Thanks!

stella’s picture

Category: support » bug
Status: Active » Fixed

The download original link is supported only for images provided by the image module and the imagefield module.

In order to see the download link for the image module, users need the 'download original image' permission (supplied by lightbox2 module) and the 'view original images' permission (supplied by image module).

To see the download link for the imagefield module, users just need the 'download original image' permission, since the 'view imagefield uploads' permission has now been removed from the "imagefield" module. I've updated the 6.x-1.x-dev version of the module to fix this.

In both cases, the text configured for the download link on admin/settings/lightbox2 needs to be set.

I've updated the help text on the admin/settings/lightbox2 form so this is made clearer.

Cheers,
Stella

Status: Fixed » Closed (fixed)

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

OnlineWD™’s picture

Status: Closed (fixed) » Active

I have lightbox2 1.9, image module is disabled and I have filefield 6.X 3.1. The only option in permissions related to download original is "download original image" under lightbox2. Anonymous users cannot see the link even though they have permission. I as admin can see link though so it is supported but only for admin.

stella’s picture

Status: Active » Fixed

Please use the latest dev version, see #9 above.

Status: Fixed » Closed (fixed)

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

timaholt’s picture

Status: Closed (fixed) » Patch (to be ported)
FileSize
509 bytes
775 bytes

I've had the same issue and created 2 patches to simply remove the extra permissions checks and rely solely on the 'download original image' permission for this feature. These might be useful for people who don't want to use the dev version but need a fix for above.

stella’s picture

Status: Patch (to be ported) » Fixed

As I said before, fixes have already been committed to the project and are available in the dev version. They will be included in the next official release.

Status: Fixed » Closed (fixed)

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

Qandeel’s picture

Status: Closed (fixed) » Needs review

@stella --- Download link is not working for imagefields, I am using your latest official release, this fix really got in to the latest release or its still in dev. if possible can you provide patch for it.

Thanks

  • stella committed 7a15410 on 8.x-1.x
    #370181 - clarified the permissions needed for the download link in the...
  • stella committed 50b11d0 on 8.x-1.x
    #370181 - 'view imagefield uploads' permission no longer exists.
    
    

  • stella committed 50b11d0 on 7.x-2.x
    #370181 - 'view imagefield uploads' permission no longer exists.
    
    
  • stella committed 7a15410 on 7.x-2.x
    #370181 - clarified the permissions needed for the download link in the...
joseph.olstad’s picture

Version: 6.x-1.9 » 7.x-2.0
Issue summary: View changes
Status: Needs review » Fixed

fixed in 7.x-2.0
if you want this fix then please upgrade to 7.x-2.0

Status: Fixed » Closed (fixed)

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