Slideshow and Node Embed

Events happening in the community are now at Drupal community events on www.drupal.org.
ksweet's picture

I'm creating an OP slideshow. It works fine when I go to that node and view it. However, when I embed the slideshow in an article, strange things happen. At first, the slideshow looks completely broken. But then if I clear the cache, it works and looks perfectly, just like it should. The slideshow is where I put it embedded in the article and it looks great. BUT, that only happens once, and when I refresh the page, the slideshow is broken. At this point, the elements aren't getting all of the classes they should be. For instance, when it's working the ul tag has these classes:

jcarousel-processed jcarousel-list jcarousel-list-horizontal

and when it's broken the ul tag has:

jcarousel-skin-custom

The other elements are similarly missing various jcarousel classes.

I can't seem to figure out why this is happening, and why it works one time after a cache clear but then never again (not to mention it always works when you go to the slideshow node itself). Any ideas?

Comments

After stepping through the

ksweet's picture

After stepping through the the page loading process a whole bunch, I finally found the culprit. It's this code in filter.module in the check_markup function:

// Check for a cached version of this piece of text.
$cache_id = $format .':'. md5($text);
if ($cached = cache_get($cache_id, 'cache_filter')) {
  return $cached->data;
}

On the second page load, this is cached, so it leaves the function here. But later in this function is this code:

foreach ($filters as $filter) {
  $text = module_invoke($filter->module, 'filter', 'process', $filter->delta, $format, $text, $cache_id);
}

One of these filters is the node embed filter, which eventually calls the theme() function on the embedded node, which allows it to be themed. But it's never making it here on the second page load.

Node Embed is a Phase2 module, hopefully someone there can give some insight on this? It seems to me like the cached copy should already be themed, I don't know why it isn't anyway. This seems like a really weird bug to me.

Just updating in case someone

ksweet's picture

Just updating in case someone else runs into this problem later. I created an issue on the Node Embed queue where I summarized the problem:

http://drupal.org/node/939334

I did not reach a solution to the problem, however. I DID manage an ugly ugly hack to get it to work for now.

This seems to me to be a big bug. Many publishers will have need for slideshows, and slideshows are usually useless by themselves, they're probably going to be with something else (hence embedded). This makes slideshows basically unusable.

To OP devs: I may be able to help more with this issue (since I've spent so much time tracking down what was wrong), but not on my work time. I'd love to hear from one of you about this though.

There's a major problem in

irakli's picture

There's a major problem in how input filters work in Drupal and the way they are cached. You can disable caching on an input filter, but in Drupal that would disable caching for all input filters in a specific input format, which would be very bad for the overall performance.

Current work-around is an editorial one: if you change the embeded content, re-save the node that the content is embedded into, which will clear cache.

A more comprehensive solution would, honestly, require creating a parallel system to existing, limited solution in drupal core. Unfortunately, we could not fit this in the 2.3 release, but we may come back to it after the 2.3 release.

.............................................
http://twitter.com/inadarei

OpenPublish

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: