Hi all. I was having a problem with rel="lightvideo" not working. I came across this issue, http://drupal.org/node/1279204, and now the most recent dev release fixed this.

However, now in Views, if I try to click on a field to edit the settings I see the loading graphic for a split second and then nothing shows up. When I uninstall lightbox2 Views begins to work again.

Any thoughts? Thanks!

- Nick

CommentFileSizeAuthor
#14 lightbox.png11.48 KBastutonet
#6 Clipboard01.png975.25 KBalexandreracine

Comments

yukare’s picture

Priority: Normal » Major

I know the error, it breaks all ajax requests, not only in views, but in all site.

The fix is simple, and i have it, replace the function lightbox2_init with this:

function lightbox2_init() {
  /* AJAX check  */
  if(!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
    if (lightbox2_exclude_these_paths() != 1) {
      lightbox2_add_files();
    }
  }
}

It do not load the javascript files from lightbox when we have a ajax request.

I do not commit this because this line:

  if(!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {

This header is used by jquery with a specific value, so i must test for this value, and not only for the header.

Please, make this change and tell if it fixes the error for you, i will work on a better fix for this.

deaconzero’s picture

This didn't fix the problem, but thank you for trying. Please let me know if you come across anything else. Thanks.

- Nick

spomerg’s picture

I am having this same problem as well. It's doing it on two separate D7 instances. When I disable the Lightbox2 module, it goes away.

yukare’s picture

Maybe disabling lightbox2 on all admin page could be a solution, or do you think that we need lightbox2 on admim pages ?

yukare’s picture

On admin/config/user-interface/lightbox2/general , in "Page specific lightbox2 settings", select "Load on every page except the listed pages." and in the box put "admin/*".

This is not a real fix, but one temporary, sorry by this. And my try at #1 is wrong, so use this and not #1.

alexandreracine’s picture

StatusFileSize
new975.25 KB

It's not related to views, since that module is not installed on my drupal. On the screenshot below, if I use something else than "image" for the display type, I get the error "An error occurred while attempting to process /system/ajax: iterator is undefined".

Was that not happening before this last commit? Why?

alexandreracine’s picture

#5 works, thanks by the way.

spomerg’s picture

Thanks for the workaround (#5); it is very much appreciated.

yukare’s picture

New try: on lightbox2.module, around line 788 there is these two lines

drupal_add_js($path .'/js/prototype.js', array( 'scope' => $js_location, 'cache' => false ) );
drupal_add_js($path .'/js/scriptaculous.js', array( 'scope' => $js_location, 'cache' => false ) );

Add a // before it to comment, it will fix the views issue, and i do not think it breaks anything on lightbox. I will commit this soon.

alexandreracine’s picture

Another place where this is affecting, if I have some images in my node, and try to delete one I get this message...

"An error occurred while attempting to process /file/ajax/field_image/und/form-PjLChzOKSO-GCQ9d8ZaraRxL5ZapBAiCu7Cyg3tlAS4: iterator is undefined"

13rac1’s picture

Subscribe. I almost want to upgrade this to critical, since it breaks all AJAX requests.

yukare’s picture

Status: Active » Closed (fixed)

I have commited a fix for it, please test it and reopen this if you still have the problem. I have it working on my personal site and it do not break anything on my "test" page for lightbox(http://www.jaguaribe.net/modulos/comunidade/exibicao-de-conteudo/lightbox-2) and fixes the issue with views and other ajax/javascript bugs.

Once i make the views work with lightbox i will make a beta release, and thanks to all testing the dev version.

mvuijlst’s picture

Fixes the issues I had, thanks.

astutonet’s picture

Status: Closed (fixed) » Active
StatusFileSize
new11.48 KB

Hello

I'm facing a problem that's related to this issue.

I can not edit or create views on a website. When I try to do it, I get the following message:

An error occurred while attempting to process http://localhost/drupal/admin/structure/views/ajax/config-item/Internals... 'ajax.form.ajaxSubmit' is not a function

I reported the problem to the developers of that module (http://drupal.org/node/1085464#comment-5286542), but I was told that probably the problem must be related to javascript.

That's when I deleted all the messages of the dblog and tried to run the operations again.

The dblog recorded the messages that is in the attached image.

Before cleaning the registry of dblog, there were many records of the lightbox and it is no coincidence that the lightbox isn't working.

Any ideas?

Thank you.

astutonet’s picture

I believe this information is important:

After some testing, I found that to I get to use the views module I should disable the use of jQuery and jQuery UI CDN in the performance page (admin/config/development/performance), losing some original features.

yukare’s picture

Status: Active » Postponed (maintainer needs more info)

#14 May be some other module make this, are you sure that all the lightbox files are in the correct place? Maybe a error in uploading the files.

#15 I do not have this setting, so which module provides it?

astutonet’s picture

#14 In relation to the views module, I suspected that problems were related to three modules: Lightbox2, jQuery Update and Ajax System. I discovered that the problem relates to the jQuery Update module (See this issue: http://drupal.org/node/1380370). As the module is no longer necessary, I just uninstalled it and everything returned to normal.

#15 the features jQuery and jQuery UI CDNI in the page of performance were provided by the jQuery Update module, which has been uninstalled, as above.

I reviewed the installation of Lightbox through the readme.txt file. I was using the beta 1 version. There are no difficulties during the installation. I discovered it was missing the folder "js" and all its contents inside the facility. So the resources didn't work.

There was just upgrade and everything went back to work again.

Thank you.

yukare’s picture

Priority: Major » Normal
Status: Postponed (maintainer needs more info) » Closed (fixed)

Since everything is working as said in #17, i am closing this again. Please reopen if you still have this issue.