If I create a view that uses JCarousel as the style plugin, set use ajax to "Yes", and add for example the Node: Published or Admin filter, I get SQL errors, as the JCarousel module does not utilise views query substitutions, so I get an error along the lines of

"user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '***CURRENT_USER*** AND ***CURRENT_USER*** <> 0) OR ***ADMINISTER_NODES*** = 1)"

Not sure on the best approach to fix this, but I'm guessing the count query in jcarousel_views_add() should take care of query substitutions? As well as possibly doing a db_rewrite_sql() just in case I don't have access to all the images being shown in the carousel?

Or is this simply not supported? If such, this should be added into the README.

CommentFileSizeAuthor
#3 jcarousel_wildcards.patch2.17 KBquicksketch

Comments

quicksketch’s picture

Thanks for the report. Seems like this should be a fairly easily solved problem.

jennypanighetti’s picture

For what it's worth, I just installed jcarousel and have the same error. Mine says it's in includes/jcarousel.views.inc line 111.

quicksketch’s picture

Status: Active » Needs review
StatusFileSize
new2.17 KB

Here's a patch which fixed the problem in my testing. I updated my local sandbox with Views 3 and found that it's a bit easier to get working (though unfortunately not quite backwards-compatible). This patch includes the Views 3 changes even though that's not really related.

aspedia’s picture

Status: Needs review » Reviewed & tested by the community

Patch fixes the problem for me here. Nice. (Views 6.x-2.x)

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Thanks committed to both D6 and D7 branches.

Status: Fixed » Closed (fixed)

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