We're using jCarousel in a complex environment including multidomain and Views 2. We found that, even with only a single node visible on the current domain, jCarousel was still putting buttons on the carousel as if it were expecting the sum total of all the domains' nodes to be rendered. Then, when it came to rendering the view, it only had one button (which you could flick horizontally over and over again, but still just one node.)

Digging around revealed that that was indeed the case in jcarousel_views_add(): when $count_query is assigned, the query needs a db_rewrite_sql() (as per Views' includes/view.inc, around l700.) This would add all the node_access joins to the query, returning the correct number of nodes. Otherwise, the ($count == 1) on l136 fails to remove buttons.

Please find attached a patch for a quick two-line change which implements a db_rewrite_sql() to fix this.

Without this patch, people might also find jCarousel breaks on other complex permissions models e.g. OG user roles, when members can see more carousel items than non-members. Basically any complex node permissions model could cause jCarousel to put buttons on single-node carousels.

Comments

quicksketch’s picture

Status: Needs review » Fixed

Thanks, committed!

Status: Fixed » Closed (fixed)

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