Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Installing the Views Distinct module causes odd behaviour for Views Slideshow module on CSS level. I do not know the exact cause of the problem, but it restructured html completely (e.g. widget pager). Uninstalling the module solved the problem. Does Views Distinct use similar classes?
Comment | File | Size | Author |
---|---|---|---|
#3 | views_distinct-skip_rerender_if_no_output_change-1956878-3.patch | 2.68 KB | jay.dansand |
#2 | select_distinct_gd.JPG | 53.51 KB | marksmith |
#2 | select_distinct_wr.JPG | 58.2 KB | marksmith |
Comments
Comment #1
jay.dansand CreditAttribution: jay.dansand commentedThe simple answer is Views Distinct doesn't use any CSS classes, or any HTML markup directly. Are you setting it to aggregate or filter duplicates? And, is the field set to "Filter/Aggregate based on the rendered value"? That option changes HTML, but only by combining rendered HTML with the given separator (default ",").
Can you describe the odd behavior?
Comment #2
marksmith CreditAttribution: marksmith commentedThe odd behaviour appears once the module is installed, that is without even starting to use it (filter or aggregate) in any views. I attached two screenshots to see the difference without (select_distinct_gd.jpg) and with (select_distinct_wr.jpg) the views_distinct module installed.
Thank you for your answer.
ms
Comment #3
jay.dansand CreditAttribution: jay.dansand commentedI think I have half of the issue solved - I changed how the hook_views_post_render() function works so it should not affect any view where Views Distinct + "Use the rendered output of this field" isn't used.
There may be an additional compatibility issue with the post_render aggregation and Views Slideshow when the View is re-rendered; I'll have to look more deeply into that. Still, this patch (also committed to the 7.x-1.x-dev branch) should at least prevent any issues if you are not using Views Distinct + post_render in the Views Slideshow view.
Comment #4
marksmith CreditAttribution: marksmith commentedThank you, Jay. Unfortunately the problem has not been solved by this update. The same behavior occurs after re-installing and enabling the new dev version of the module.
ms
Comment #5
marksmith CreditAttribution: marksmith commentedNow I think I have found something here! Although I do not know why it happens, but this is what I observe on the CSS level.
When the views_distinct module is enabled (but prior to being implemented in any views) the div id-s of the original Views Slideshow are altered, the original id being appended by a _2. So for example #views_slideshow_cycle_main_news-block_2 is changed to #views_slideshow_cycle_main_news-block_2_2, #widget_pager_bottom_news-block_2 is changed to #widget_pager_bottom_news-block_2_2. I hope, Jay, this will help you figure out the exact cause of the problem.
ms
Comment #6
jay.dansand CreditAttribution: jay.dansand commentedThat definitely does help, thanks! I'm swamped today, but I'll try to look at it early next week.
Comment #7
jay.dansand CreditAttribution: jay.dansand commentedQuick update: it looks like the "_2" suffix is being appended by Views Slideshow in "theme/views_slideshow.theme.inc" in function
_views_slideshow_preprocess_views_slideshow()
:It's
$vss_id
that ends up becoming "example_2", because Views Distinct calls$view->display_handler->render()
a second time when post-rendered filtering is used. I don't know how to avoid doing that, but I'm investigating it.I wasn't able to get this behavior to manifest without enabling Views Distinct on that View, though. I had to go into the fields on the slideshow view and enable Views Distinct w/"Use the rendered output of this field" checked. As far as I can tell, the latest dev (and the patch in #3) should have solved that part of the issue, anyway. If you're still observing this on views without Views Distinct enabled on the view, I'd be grateful for more information, because I haven't been able to replicate that.
Comment #8
jay.dansand CreditAttribution: jay.dansand commentedThe following caveat has been added to the KNOWN ISSUES section of the README.txt and project page for a couple of months now:
I have not been able to reproduce the problem described here: manifesting the error even when "Use the rendered output of this field" is turned off.
I'm closing this issue as "cannot reproduce" for now; please re-open if you are still encountering this problem with "Use the rendered output of this field" disabled. Thanks!