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."

Comments

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.

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?

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.

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

Status:Active» Closed (fixed)

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

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

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

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

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)

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

Status:Needs work» Needs review
StatusFileSize
new1.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.

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.

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

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

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

Yes - works here - did you clear cache?

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

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

Priority:Normal» Critical

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

#11 worked for me too.

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

#11 patch works. Thanks, troyer.

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.

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.

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!!

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.

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

I'm also not seeing replacement patterns.

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

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

Patch #11 works here as well. Please commit.

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

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?

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.

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.

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

Status:Needs work» Active
Issue tags:+D7 stable release blocker

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

+1

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.

+1 Patch #11 fix also for me. thanks

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

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?

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

@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)

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.

Hi Yukare,

Please release the stable version.

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

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.

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).

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?

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.

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?

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

<?php
$imgsrc
= $matches[1];
?>

could be made assumption proof by
<?php
$imgsrc
= (!empty($matches[1])) ? $matches[1] : '' ;
?>