Hi, i'm trying to figure out how the Slideshow_Creator module is working and discovered it's not working with my Drupal 6.22 installation.

I'm using the latest Slideshow_Creator:

version = "6.x-1.35"
core = "6.x"
project = "slideshow_creator"
datestamp = "1292131537"

The Problem

I've created nodes and blocks with slideshows of about 10 photos. This is the code I used:

[slideshow: 2, img=|sites/default/files/foto/slide/01.jpg|||||, img=|sites/default/files/foto/slide/02.jpg|||||, img=|sites/default/files/foto/slide/03.jpg|||||, img=|sites/default/files/foto/slide/04.jpg|||||, img=|sites/default/files/foto/slide/05.jpg|||||, img=|sites/default/files/foto/slide/06.jpg|||||, img=|sites/default/files/foto/slide/07.jpg|||||, img=|sites/default/files/foto/slide/08.png|||||, img=|sites/default/files/foto/slide/09.jpg|||||, img=|sites/default/files/foto/slide/10.png|||||]

This works pretty good at the first time I load the page but as soon as I leave the page with the slide or visit another page with the same slide, it's screwed up. All images are shown one below the other.

I've spend some time to find out what's happening and I noticed the .css- and .js-files of the Slideshow_Creator and jQuery_Plugin are not added to the page.

Possible workaround

I was looking within the code for the function that adds these files to the page and noticed they where added with theme_slideshow_creator()-function within the slideshow_creator.inc-file at lines 281-286.

  // Add the CSS file
  drupal_add_css(drupal_get_path('module', 'slideshow_creator') . '/slideshow_creator.css');

  // Add the main JavaScript, that does all the magic
  drupal_add_js(drupal_get_path('module', 'slideshow_creator') . '/slideshow_creator.js');
  drupal_add_js(drupal_get_path('module', 'jquery_plugin') . '/jquery.cycle.min.js');

I created a hook_init()-function at top of slideshow_creator.module adding these lines permanently to find out if this helps. (I know this is a pretty dirty workaround.) But it didn't work. The CSS/JS got added to any page now and the CSS seems to work, but the slide only shows the first image and does not do anything.

Not sure what else I can try.

Is there anything I can do? Is this a known issue?

  • I've been reading README.txt and documentation closely.
  • I even tried the example code:
    [slideshow: 2, img=|http://drupal.org/sites/all/themes/bluebeach/logos/drupal.org.png|drupal.org|Drupal|The ultimate CMS. Download it now!|Drupal|, img=|http://www.mysql.com/common/logos/mysql_100x52-64.gif|http://www.mysql.com|MySQL|Free and reliable SQL server and client.|_self|, dir=|files/|yes||Generic Photos|Aren't they great?||]
    

    - same problem.

  • I also tried to disable my customized theme and used Garland - same problem.

I may have some more time to search the code but do you have a hint where to look at?
Thanks!

CommentFileSizeAuthor
#18 page-reload-fix-1182302-17.patch4.82 KBrhouse
#6 header.txt34.73 KBdonSchoe
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

donSchoe’s picture

Title: Slideshow broken: not loading css + js files » [Slideshow_Creator broken] Not loading .css + .js files / Cache problem?
Priority: Major » Critical

actually this is critical as the module is broken.

and i just noticed this is a known issue #1160842: overlay:hidden not honored on cached page?, sorry for creating a new one.

something similar has been reported in a couple of recent comments on the doc page.

I am using
version = "6.x-1.35"
datestamp = "1292131537
drupal = 6.19
browsers=opera,chrome,firefox on linux

running the sample slideshow provided in the documentation, I noticed that while the slide show works fine on first view all subsequent accesses to the page show all the images in the slideshow next to each other. This does not seem to be a problem with the cycle js plugin: if I disable javascript using firefox noscript I see that the page displays fine until I click either refresh or the "next slide" link. After that all images appear next to each other (see
https://www.acceleratecarboncapture.org/drupal/public/slideshow-test-page). When I empty the site cache everything is back to normal for one access.

It almost looks like the overlay:hidden in slideshow_creator.css is not honored when a page is displayed from cache.

rhouse’s picture

I am also using this core version and this slideshow creator version, and I cannot see any problems. You might like to look at any of the many dozens of pages of http://wingedhearts.org and see if you can break any of the slideshows there. It might be that I am not using the exact feature of the module that causes the breakage. It was because I need it for that site that I volunteered to maintain the module, but I didn't write it and I might be misunderstanding something that it is doing, so if you can find the difference between how I use it and how you are using it, so I can test it better, that would be very helpful.

Here are some pages at random:
http://wingedhearts.org/featherytales/ft7
http://wingedhearts.org/thestickybeak/st3

rhouse’s picture

Don, I've just noticed something on your sample slideshow. When I hover over a next link on my site, I see this:

On page: http://wingedhearts.org/featherytales/ft7
I see: http://wingedhearts.org/featherytales/ft7?ssc=1,2

But with your test site:
On page: https://www.acceleratecarboncapture.org/drupal/public/slideshow-test-page
I see: https://www.acceleratecarboncapture.org/drupal/category/tags/public?ssc=1,2

I wonder if there is something like the site base url or something else that is messing things up?

donSchoe’s picture

Hi,
I haven't been around for the weekend and didn't change anything. I've tested the module with another Drupal 6.22 installation and it's the same problem. http://141.45.160.88/node/3

It displays all pictures at once and the "next" links are not working.

The ACC is not my site. But indeed it's strange, this one is not working: https://www.acceleratecarboncapture.org/drupal/public/slideshow-test-page but this one is: https://www.acceleratecarboncapture.org/drupal/welcome The working slide is an animated PNG-file.

Would be interesting to find out how calaf fixed this!

donSchoe’s picture

This code:

<p>[slideshow: 2, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/01.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/02.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/03.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/04.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/05.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/06.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/07.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/08.png|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/09.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/10.png|||||]</p>

On 3 different Drupal 6.22 installations:

To avoid problem with my own code, I also added the code from the documentation at all 3 sites:

[slideshow: 2, img=|http://drupal.org/sites/all/themes/bluebeach/logos/drupal.org.png|drupal.org|Drupal|The ultimate CMS. Download it now!|Drupal|, img=|http://www.mysql.com/common/logos/mysql_100x52-64.gif|http://www.mysql.com|MySQL|Free and reliable SQL server and client.|_self|, dir=|files/|yes||Generic Photos|Aren't they great?||]

It's not working at all, and: always the same problem: CSS + JS not added to page header. Now, we need to find out why.

It would be really interesting to have a look at a site where it is working.

donSchoe’s picture

FileSize
34.73 KB

I've been looking into the module and comparing the headers of all the sites linked above. (See attached file.)

Results

  • Your page doesn't even have any slideshow_creator-css and -js files in the header. Where is the code added? How does that work? Are you using v6.x-1.35 of the Slideshow_Creator?
  • Forcing to add the css and js files on any pageload (using slideshow_creator_init()) does not fix the problem. Only CSS is added correctly, but the JS is not working.
  • The files get added within the theme-function theme_slideshow_creator($ss) (lines 281-286 of slideshow_creator.inc). This might be the problem. When and how often are theming functions called?
rhouse’s picture

Gosh this is a real puzzle. I am swamped with other jobs just now, but I have turned off all optimisations on wingedhearts.org temporarily, so you should be able to investigate what js is loaded. A quick look, I see it is there. But why it is and yours isn't I just don't know. If I could simulate the problem I might have half a chance at fixing it. I'll go through all your suggestions carefully soon, but unless I can reproduce the bug I won't know if any changes I make are doing any good.

BTW, where are the sites hosted? I know godaddy breaks drupal for sure. Again, I don't know why, I just know i had to change hosting company. (Currently with Hotdrupal - extremely good service and site responsiveness.)

rhouse’s picture

The other thought I had: the order of the input filters. This is the order on wingedhearts.org:

HTML Corrector
Internal Path Filter
Paging
Slideshow Creator
URL filter

rhouse’s picture

From @4: the test page did indeed work on Sunday, and not because I was fooled by an animated gif. Then it stopped working by Monday.

donSchoe’s picture

@#7: the sites are all hosted at my university but on different server setups. i could try to setup one at my private server.

@#8: I tried to change this order (moved URL filter to bottom, etc.) but it didn't change anything. My initial setup:

  • URL filter
  • Line break converter
  • HTML corrector
  • Slideshow Creator

@#9: I just opened my slide and: it worked!!! But as soon as you reload the page it's broken again. Seems pretty much to be a caching problem.

And yes, indeed, as soon as I empty chache (admin/settings/performance) the slide works again but only once. My performance settings are:

  • Caching mode: disabled
  • Minimum cache lifetime: none
  • Page compression: enabled
  • Block cache: disabled
  • Optimize CSS files: disabled
  • Optimize JavaScript files: disabled

Changing these settings did not change the behaviour of the page. It's still working only on first visit.

We need to find out how to force that drupal loads the code on any page load. But it's still confusing why it is working with your site :)

rhouse’s picture

My settings:

Caching mode: works both ways
Minimum cache lifetime: none
Page compression: enabled
Block cache: works both ways
Optimize CSS files: works both ways
Optimize JavaScript files: works both ways

Since my site is bulletproof to changes in the performance settings, I think the problem is somewhere else.
The puzzling thing is that each page load is a separate operation, so how can it know that the page was loaded before?
More details: Using linux, debian, apache2.

donSchoe’s picture

Since my site is bulletproof to changes in the performance settings, I think the problem is somewhere else.

That's confusing.

Okay. Either

  • the module is not handling the files correctly or
  • the server does some strange stuff with the files of this module.

The servers I'm using:
2x InterWorks dedicated servers, virtual, linux
1x I dont know ;)

I'll try another server type a.s.a.p.

rhouse’s picture

Okay, it doesn't seem to be filter order, performance settings, or site base url setting. Both sites use linux. Are they both using apache2? Perhaps there is a dependency on a particular apache mod? On my test box I am running, my listing for /etc/apache2/mods-enabled is:

alias.conf@ authz_default.load@ autoindex.conf@ deflate.load@ mime.conf@ perl.load@ rewrite.load@ status.load@
alias.load@ authz_groupfile.load@ autoindex.load@ dir.conf@ mime.load@ php5.conf@ setenvif.conf@
auth_basic.load@ authz_host.load@ cgi.load@ dir.load@ negotiation.conf@ php5.load@ setenvif.load@
authn_file.load@ authz_user.load@ deflate.conf@ env.load@ negotiation.load@ python.load@ status.conf@

I don't know what the production site is running, but as things work fine there I haven't asked. If you have any extras not in this list, or any missing modes that I have present, I'll try swapping mods in or out one at a time to see if I can break my test site.

donSchoe’s picture

My main problem is I only have limited access to the servers I use so it's hard to provide full information about the setup.

But this problem is hihgly reproducable. 4th try with a complete different server: http://sandbox.schoedon.nl/6/node/1

rhouse’s picture

Okay, what exact steps did you take to make that site - which modules, which versions? I'll try to reproduce.
Also please list the exact slideshow filter text you used to display that slideshow, just in case it is some overlooked problem in there.

donSchoe’s picture

  • Step 1: Clean installation of Drupal 6.22
  • Step 2: Module installation of jQuery Plugin 6.x-1.10
  • Step 3: Module installation of Slideshow Creator 6.x-1.35
  • Step 4: Adding "Slideshow Creator" as filter to input type "Full HTML"
  • Step 5: Creating content as "page" with the following code:
    [slideshow: 2, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/01.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/02.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/03.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/04.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/05.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/06.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/07.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/08.png|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/09.jpg|||||, img=|http://uxlab.htw-berlin.de/sites/default/files/foto/slide/10.png|||||]
    

    ... and using input type "Full HTML"

That's it. I didn't touch any settings.

rhouse’s picture

Thanks muchly, I'll follow those steps and see where it gets me. I'll post back my results.

rhouse’s picture

Title: [Slideshow_Creator broken] Not loading .css + .js files / Cache problem? » [Slideshow_Creator broken] Not loading .css + .js files - fixed
Status: Active » Needs review
FileSize
4.82 KB

The mysterious bug has been found! There is a variable called Drupal.settings that is supposed to convey information from the server to the javascript on the client. There is also a history of module maintainers tearing their hair out and going mad, and, incidentally, relying on Drupal.settings in their modules. It turns out Drupal caches information even when it says caching is turned off, and thus not all code on the server is recalculated, even with "no caching". This apparently can't be turned off, nor do we want to run every page with no caching. Sadly, the contents of Drupal.settings are never cached, so they are computed once when the page is first rendered and never again, but used only once and then thrown away.

Anyway, to avoid the fate awaiting any who struggle with Drupal.settings, I have rewritten the module to put the javascript settings into the html, where it can be evaluated once, cached, and retained for next time. Everything seems to go fine now, regardless of caching mode. To get it to you as quickly as possible, and also so you can get a chance to test it and give me feedback before I make a new version, here it is as a patch file on version 6x-1.35.

donSchoe’s picture

Status: Needs review » Reviewed & tested by the community

patch applied cleanly, slideshow working well! good work!

rhouse’s picture

Status: Reviewed & tested by the community » Fixed

Thanks heaps, I guess it's time to put out a new version. (1.36?)

Status: Fixed » Closed (fixed)

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