Just installed the dev version for D7 and tried to use the lightbox trigger field in views. I can add it, but in the configuring box it states:

"The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item."

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yukare’s picture

Status: Active » Closed (fixed)

I just commited a fix for this, is only change the api version from 2.0 to 3.0. I did some basic testing and it works, but not a real use case, so please, try to use it and report again if it do not work or have any error.

swirt’s picture

I'm using the September 19th 2011 version of lightbox2 7.x-1.x-dev along with views 7.x-3.0-rc1.

Upon trying to add the lightbox trigger field to a view, I am getting the same result error as the original poster.

"The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item."

Is there a solution to this?

yukare’s picture

Status: Closed (fixed) » Active

This is strange because i commited a fix for this (http://drupalcode.org/project/lightbox2.git/commit/ae40acd) so it is in git, but it is not in last dev, in the line 1527 of the lightbox.module file, change where is '2.0' with '3.0'.

Please make this change or get the code from git, i do now know why the last dev do not have it. I will do some others changes today and see if the next dev contains it.

Thanks.

swirt’s picture

Thanks. I will make that change and give it a try.

yukare’s picture

Status: Active » Closed (fixed)

This is closed on git, just wait for the next dev.

kappaluppa’s picture

Any idea when the next dev is coming out? I needed this too, but used a work around.
thx

Sinan Erdem’s picture

I am using the latest version. I checked that the API is written as 3.0. Nevertheless, the same error continues for me...

circuscowboy’s picture

Status: Closed (fixed) » Needs work

I am using the latest dev as well - I even un-installed and re enabled the module

I still get the same error (the 3.0 is included in the dev)

The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.

this is with views 7.x-3.0-rc3

troyer’s picture

Same problem here, using latest Lightbox2 dev 10/13/2011, Views 7.x-3.0-rc3 and CTools 7.x-1.0-rc1.

Broken/missing handler (Broken handler lightbox2.lightbox2)

Leon Kessler’s picture

The issue is because of the new autoload functionality in D7 core. Handlers are now defined in a modules .info file and not via the hook_views_handlers().

Here's a patch to fix the problem.

Thanks

troyer’s picture

Status: Needs work » Needs review
FileSize
1.12 KB

I've tested the patch, it works fine now. Only thing I had to correct was the closing curly bracket. Here's the adjusted patch from http://drupal.org/node/1271456#comment-5286170

You might have to clean the views cache to see it working.

troyer’s picture

Status: Needs review » Reviewed & tested by the community

Because I only added one curly bracket to the patch I've tested, I'm setting the status to review & tested.

d_hall’s picture

I got the patch to work. But can't get anything to appear in the caption field. :(

troyer’s picture

Could you please file a separate issue as a support request? This is a bug report that's already reviewed and tested.

Learn more about token here: http://drupal.org/project/token

Caligan’s picture

Is this still applicable to the most recent update of Views? I've applied the patch with no success - still no trigger handler available.

circuscowboy’s picture

Yes - works here - did you clear cache?

Souvent22’s picture

The hook_views_data isn't loaded as it seems lightbox2.views.inc isn't parsed at all.

Leon Kessler’s picture

Souvent22 that's the problem my patch solves. Have you tried clearing your cache?

markhalliwell’s picture

Priority: Normal » Critical

Patch in #11 worked. Please commit so the field works in Views.

attheshow’s picture

#11 worked for me too.

stevedc’s picture

#11 worked for me as well. Great job troyer.

cwithout’s picture

#11 patch works. Thanks, troyer.

carn1x’s picture

Patch in #11 works great.

However in the Popup description for the field config it says "Combine tokens from the "Replacement patterns" below and html to create what the lightbox popup will become." however I'm not seeing any Replacement Patterns below.

serkuz’s picture

Yes. The patch works.
I could figure out the replacment pattern in my case by entering the field name in brackets - e.g.: [field_content_image_1] and it works for me.

cmiguel’s picture

Yes. The patch in #11 works, for me too.
Thank you
Troyer

Newbies to patching (like me), might try manually patching with a text editor such a Notepad.

This is a small patch, and is really easy to follow.

Have a look here, for some manual patching tips:
http://drupal.org/node/534548

Backup, be careful, try at testing site first. Good luck!!

cabita’s picture

The patch #11 doesn't work for me. The field "Lightbox" in the list of view filters is not shown after the application of patch. I have tried clearing the cache. I have tried the patch on the version dev and version beta of lightbox2. I have the version of views 7.x.3.3. and drupal version is 7.14

Thanks for your help.

eeyorr’s picture

@cabita - Are you looking in fields or filters? The lightbox trigger is a field.

I'm also not seeing replacement patterns.

mark@redhorseinteractive.com’s picture

I don't see replacement patterns either. I can open a lightbox window with nothing in it now.

xturgorex’s picture

Applied #11 on lightbox2-7.x-1.x (Janurary 1, 2012) and it works.

gandhiano’s picture

Patch #11 works here as well. Please commit.

jakew’s picture

Same problem... patch fixed it - 7.x-1.0-beta1

Po3t’s picture

I'm running 7.x-1.0-beta1 and I'm still encountering this issue. It's been over a year since this was originally reported. Can we get this patch committed to the official release yet?

jjjjack’s picture

The patch in #11 allows the trigger to show up and work, but as others have noted, replacement patterns aren't visible. In my case, Token is installed and working fine with other modules.

matthew1585’s picture

I got sick of wasting many hours fiddling with broken lightboxes. I found most of them aren't compatible with many browsers anyways. This one works in every browser I've used: jQuery Combo Pack. It's also super lightweight and fast.

kentjames1980’s picture

Status: Reviewed & tested by the community » Needs work

Can this pleaseeeeeeeeeeee be fixed and committed, I need my lightbox working with views so I can attempt to attach it to node gallery!

The more I try to get on with D7 the more frustrated I get and wondering why I bothered

nally’s picture

Status: Needs work » Active
Issue tags: +D7 stable release blocker
freebug’s picture

The patch from #11 worked for me.

After replying the patch, do not forget to clear the cache.

One more thing, if the replacement tokens do not appear, get it from the field added above this field in the view.

Thanks

bshaddad’s picture

+1

rdrh555’s picture

Status: Active » Reviewed & tested by the community

Using Lightbox2 7.x-1.0-beta1 and Views 7.x-3.6 and got the same error as original poster. Patch #11 works for me.

milekium’s picture

+1 Patch #11 fix also for me. thanks

kapis’s picture

patch works but I'm not seeing the image in views. Am i missing something?

scottzee’s picture

Patch worked (thanks!), but the replacement patterns don't appear.
When I try to add them based on the other fields ([title], say, for the caption), nothing happens at all.
Any ideas, anyone?

TomasBru’s picture

What exactly should I change manually if I don't have the possibility to apply the patch? Thanks.

Sinan Erdem’s picture

@TomasBru, just remove the lines with - sign and add the lines with + sign to the relevant files (do not add + in front of the new lines). Each relevant file is indicated on the lines like this:

diff --git a/lightbox2.info b/lightbox2.info

(Patch on comment #11 has two files to edit)

yukare’s picture

Status: Reviewed & tested by the community » Fixed

Thanks to everyone, and to troyer by this path.
It is commited now: http://drupalcode.org/project/lightbox2.git/commit/14275a5

I plan a stable release next weekend so please test the current dev, as there are some other changes on it.

Status: Fixed » Closed (fixed)

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

saurabh.arya’s picture

Hi Yukare,

Please release the stable version.

kentjames1980’s picture

+ 1 for the stable release version, Ive got a website that needs lightbox and I cannot make it work!

hwasem’s picture

Status: Closed (fixed) » Active

Reopening as this seems to have gotten auto-closed. I just installed the latest dev and had to patch with #11 to get it to work.

The replacement patterns, however, are still not showing up. I was able to get them from opening a different field and copying/pasting the patterns from that field. Would be nice if it was included in the same screen.

yukare’s picture

Please, are you sure about it not working with latest dev? Because we comited another change and it was working with views in a very improved way than this patch does. Please tell me the version you have(you can see it on lightbox.info file).

hwasem’s picture

Thanks so much for your quick reply.

My apologies. I thought I was using the dev, but I was using the beta. It is working without the patch with views on dev. I'm still not seeing the replacement patterns. Should they be there?

Do you have an ETA on the full release of the module?

vwX’s picture

Attached is a patch that adds replacement patterns, borrowed from colorbox module. It also fixes the trigger to work correctly with grouping.

To get the trigger to work:
1. Define two fields in your view, one for the thumbnail and one for the original. Hide these fields from display. Formatter should be image, not lightbox2.
2. On the lightbox trigger, make sure it is set to display. Point the trigger field to the thumbnail and in the popup add the replacement pattern for the original image.
3. If you want a custom group, set the custom lightbox group.
4. Save your view.

freebug’s picture

zerobyte’s picture

The patch #52 finally made the replacement patterns available and Lightbox2 works now.

The only problem I'm seeing after applying this patch is that I'm getting an error message:

Notice: Undefined offset: 1 in lightbox2_handler_field_lightbox2->render() (line 189 of /var/www/sites/all/modules/contrib/lightbox2/lightbox2_handler_field_lightbox2.inc).

Line 189 shows this piece of new code that was added as part of the patch:

$imgsrc = $matches[1];

Anyone have any idea why I might be getting this error?

swirt’s picture

I am not sure what would be causing $matches[1] to be non-existent but its use is making an unsafe assumption.

$imgsrc = $matches[1];

could be made assumption proof by

$imgsrc = (!empty($matches[1])) ? $matches[1] : '' ;

  • yukare committed 14275a5 on 8.x-1.x authored by troyer
    Fix for issue #1271456 by troyer: Lightbox Trigger in Views broken
    
  • yukare committed ae40acd on 8.x-1.x
    Issue #1271456 by yukare: Lightbox Trigger in Views broken
    
    

  • yukare committed 14275a5 on 7.x-2.x authored by troyer
    Fix for issue #1271456 by troyer: Lightbox Trigger in Views broken
    
  • yukare committed ae40acd on 7.x-2.x
    Issue #1271456 by yukare: Lightbox Trigger in Views broken
    
    
joseph.olstad’s picture

Version: 7.x-1.x-dev » 7.x-2.0
Issue summary: View changes

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

joseph.olstad’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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