I have come across what seems to be a bug in the ThumbnailHover option. I have four fields: a URL textfield that points to a video file, a large thumbnail, a small thumbnail and some description text. Outputting these fields as they are works fine - I see all the correct data for each node. However, when I rewrite the large thumbnail field to use the URL textfield so that when its clicked, it plays the video in a Lightbox, it pulls in the URL textfield from the preceding node. If its the first node, then it uses the last node's URL. If I still keep the URL field as an output field, it shows the correct URL, so its only on a rewrite, that something goes wrong.

If I then switch the View style to a regular HTML list or even the SingleFrame VS, everything works fine again. It just seems to be with this one version of VS. All caches have been cleared multiple times, and it happens in Chrome as well as FF. I also tried the 2.x-dev version, but its still doing it. So far, the only way to bypass this problem is to use SingleFrame mode and overlay the auto-generated thumbnail from the larger image with the small thumbnail image using CSS. Not ideal, but it should work in theory.

Has anyone seen this before? Or am I doing something wrong (don't see how though)?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

intyms’s picture

you can use Global: Custom text field to achieve the desired result.
maybe its not the best solution, but i guess it can solve your problem.

sethcohn’s picture

Component: User interface » Code

It looks like there is definately an off by one error someplace. I just discovered the same/similar issue: rewriting a field (to combine items) would end up with some info from the current result row, but some from the previous result row.

Changing from Slideshow to HTML List, the combined rewritten fields are correct (AA BB CC), then switching back to Slideshow, I end up with A (The Main Item) and thumbnails with AB BC CD DE EA (or something like that... you get the idea)

I'll see if I can track it down now... this is a pretty major bug and I need this functionality.

sethcohn’s picture

Ok, narrowed the problem down to how it occurs:

If you set up your rewrite to use the _current_ field, something gets confused, and will start using the previous field(s)... I believe (after some quick glance at the code in views_slideshow_thumbnailhover.theme.inc that due to the field(s) in question being displayed or not, combined with trying to change the existing field into a rewritten field (ie change field B3 to become B1-B2-B3) and it's falling back to the previous field values (ie B3 becomes A1-A2-B3 or B1-B2-A3, not sure which is the case here, still debugging under a time crunch to just get it working) which aren't being reset to empty inside the loop.

This is why using a fresh "custom text" field fixes the problem: it's not part of the field mix that it ends up becoming so it's exempt from the confusion and misloading of older values.

davemybes’s picture

Component: Code » User interface

Nice idea, and it actually now links to the right video for the thumbnail, but the main image is the one that is wrong now, and pulls in the previous node's image.

sethcohn’s picture

Yes, it's still got an off by one error someplace.

If you dump the view->result (or rows) the order is as expected, but somehow the items rendered in the breakout are incorrectly, with the last item _first_, throwing the entire breakout off by one.

sethcohn’s picture

Component: User interface » Code

And this is a code error, not an user interface error, so please don't change that.
The display is wrong, but it's clearly someplace in the code that needs to be fixed, not a interface problem.

sethcohn’s picture

The off by one error is solvable by following directions here:
http://drupal.org/node/774056#comment-2917816

"Exclude the fields that are in your custom text
and you will need to check the boxes to include those fields in the slideshow."

If you don't check to include the fields in the slideshow, the theming function grabs incorrect info, leading to the 'off by one' error. I narrowed the problem down to

$view->field[$field]->theme($node);

Which pulls the wrong info as a result, despite being given the correct node.
(passing it the first node, it ends up returning the _last_ node's rendering instead).
Checking all of the fields used in the custom text eliminated this, returning the correct field/node rendering.

Hopefully the patch mentioned there in #774056: Thumbnail Hover - main frame ignores views tpl override as 'in a future release' will truly solve this. Not marking as duplicate, as that issue is already closed (and a support request).

redndahead’s picture

Status: Active » Postponed (maintainer needs more info)
FileSize
4.59 KB

Can you see if this patch renders items better?

davemybes’s picture

Didn't mean to change the category - I think I had my reply open and then you posted a couple of messages, changing the category, so when I eventually saved the reply, it looks like it changed it back. Anyway, thanks for the custom field clarification, I wasn't using it as the final output field,

The patch seems to do the job! Thanks.

redndahead’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Status: Postponed (maintainer needs more info) » Needs review
FileSize
4.7 KB
4.7 KB

Friends don't let friends write patches when tired. This should be a better patch, but I'm glad it's working.

sethcohn’s picture

Version: 6.x-2.x-dev » 6.x-2.0
Status: Needs review » Reviewed & tested by the community

Yes, that patch works, and removes the (incorrect IMHO) requirements that items be included on the slideshow itself even if not displayed. It introduces a bit of a confusing conflict of options in that you can mark a field as "Exclude from display" and if checked in the slideshow settings, it will appear anyway... But this is still better than the unpatched version.

+1

redndahead’s picture

Thanks for testing. Yeah this makes marking exclude from display not really necessary anymore, but maybe in the future I can make it so that if an item is marked excluded from display it isn't an available checkbox in the slideshow settings.

redndahead’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
5.89 KB

Actually was easier than I thought. Can you please review this one which removes the field from the slideshow settings if it's set to be excluded.

sethcohn’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Status: Needs review » Reviewed & tested by the community

oops, changed version incorrectly. Patch is for 2.x-dev...

sethcohn’s picture

Status: Reviewed & tested by the community » Needs work

Oops... found a bug in patch-3
given field A, set it for visible.
Set slideshow to display it (checkbox).
Now set field A as not visible for display.
Checkbox for slideshow vanishes, but field is still used (and visible)

You should display all checkboxes, but maybe make them disabled (uncheckable), and ensure the value is forced to not usable?

redndahead’s picture

This is going to be tough. To make it not display you would have to resave your settings. I can see about checking if the field is excluded before displaying.

redndahead’s picture

Status: Needs work » Needs review
FileSize
5.98 KB

Don't listen to me when I say it's tough. I just cut out more than I should have.

redndahead’s picture

Status: Needs review » Fixed

Patch committed.

Status: Fixed » Closed (fixed)

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