Closed (fixed)
Project:
jCarousel
Version:
7.x-2.0-alpha1
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2010 at 18:19 UTC
Updated:
22 Feb 2011 at 03:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
amirtaiar commentedAm I the only one with this problem?
Comment #2
larowlansee http://drupal.org/node/983820
Views support is still WIP
Comment #3
amirtaiar commentedThank you.
Any timetable?
Can I use it without view? If not then why it publish in the D7 version?
Comment #4
quicksketchYeah as stated Views doesn't currently work with jCarousel on Drupal 7. You can use jCarousel as an API still in the Drupal 7 version (see the help page at admin/help/jcarousel for examples). That and publishing a D7 version gets other users that are using the module to try and collaborate. I'm not using Drupal 7 yet so I don't have a need for it, but of course I'd like it to be working like everyone else.
Comment #5
Michiel M-effect commentedThe integration with Views isn't working for me either. Would love to use it.
I tried looking at the suggestion Mori gave here: http://drupal.org/node/992472.
I didn't really understand it, and couldn't get it to work.
Comment #6
maartendeblock commentedI found a way how to get it to work. Probably the same way Mori did it. I wrote an article about it here: http://www.maartendeblock.com/article/drupal/a-working-views-slideshow-w...
Comment #7
roam2345 commentedfollowing issue
Comment #8
roam2345 commentedBetter module out there http://drupal.org/project/views_slideshow .... why reinvent the wheel?
Comment #9
dominateyourmarket commentedfollowing issue, I got the same results in views the style jumps back to unformatted on D7
Thanks
Comment #10
amitaibuHere's a snippet I use until there will be a Views integration. It takes the Views result and formats it to get it inside a jcarousel. Obviously you will have to do some modifications to the view name. display ID and the fields you want to see .
Comment #11
anruetherthat code gives me a couple of errors:
...perhaps I shouldn't say errors, since it prints out "notice". But there is no carousel showing up...
Comment #12
amitaibu@anruether
Notice that I send my own custom argument, you should probably change it to your own argument (if you have any).
Comment #13
anruetherOk..i didn't know that that is an argument. I will have to learn some php that is used by drupal. I will give it a try! Thanks!
Comment #14
anruetherI didn't get any output... this is my php and I tried it with different views:
Comment #15
willmoy commentedConfirm the style jumps back to unformatted on D7 with 7.x.2.2-alpha1
Comment #16
WilliamV commentedConfirm as well. Is the dev-team aleready working on this issue?
Comment #17
quicksketchNo, not currently. I'd be happy to look at any patches, but I haven't yet started building client sites on Drupal 7.
Comment #18
snufkin commentedAll is well, one just needs to register the files in the info file. There is another bug with the queries, thats up next on my list.
Comment #19
snufkin commentedFixed a API calls, removed reference to the pager (probably should be removing views 2 support as well since there is no views 3 for Drupal 7). Also removed the query that would count the number of results of the view - we can just use count($view->result) instead, works fine.
So far tested with a display of 3 items of a set of 10, worked fine in cycle.
Comment #20
snufkin commentedOne should also move the template file to the includes dir, but I can't do a diff on that for CVS.
Comment #21
WilliamV commentedhaving problems applying the patch. can you post adapted files? I've overseen something manually i guess. Thx.
Comment #22
snufkin commentedWhats wrong with the patch? try moving to the module folder and do a patch -p0 < 992726-jcarousel-drupal7_0.patch
Comment #23
quicksketchThanks @snufkin! I'll review when I get a chance. Curious to see if these changes work with the D6 version of Views also (2 or 3). It'd be great to get rid of that count query from all versions, since it's both an extra duplicate query and has some issues (like #1017582: Relative date-based filters not working).
Comment #24
quicksketchI took a look at this patch it looks like it would *almost* work, however there's a definite short-coming that would prevent it from actually working. Instead of this (admittedly really ugly looking piece of code):
The count is just generated with this:
I really wish this would actually work, but it isn't the same logic. The previous code actually determines how many items there are *total* in the whole carousel. The second just reports how many are on the current page. If you enable AJAX, the number of items on the first page is likely to be something small (like 4 or 10), which the total number of items will probably be 20 or more (since that's when you'd want to use AJAX). Maybe the previous code can simply be restored and it would work with Drupal 7's Views 3?
In any case, here's @snufkin's patch backported for Drupal 6 use, which needs to maintain both Views 2 and Views 3 compatibility.
Comment #25
quicksketchHere's a reroll with the problem I mentioned in #24 fixed. Still not great but at that code segment is doing what it was before the patch. I've also moved the jcarousel-view.tpl.php file as part of #998490: No such file or directory: jcarousel.views.inc, so that change is no longer necessary when testing this patch against HEAD.
Included are both D6 and D7 versions for consistency. Yes I know it's silly to update Views 2 code in D7, it's for consistency between versions for maintenance.
This patch still doesn't work the way you'd expect with AJAX results, but at least it doesn't throw any PHP or JS errors. When combined with AJAX the results are either missing or incorrect. Otherwise it looks like this gets Views working in D7, which is a start.
Comment #26
WilliamV commentedAfter applying D7 patch still get the
'When trying to implement the carousel style for the view nothing happens and it jumps back to the latest style (unformatted)'
error.
Please advise.
Comment #27
quicksketchYou need to flush your Drupal cache after applying the patch.
Comment #28
quicksketchI've committed these patches since it's definitely an improvement in our D7 Views support (which didn't work at all previously). I've separated out the remaining issue into #1053118: Views AJAX support does not work in Drupal 7.
Comment #29
snufkin commentedthis actually doesn't work for me, I get the following error:
whereas
$count = count($view->result);works just fine, and it returns the same count wether its ajax or not. D7 only, haven't tested it on d6 and views 2.Comment #30
snufkin commentedOh, didnt see you committed while i was writing that reply. The error still stands though, but this time its line 129
Comment #31
quicksketchOh hmm. I'll have to update my D7 sandbox. Probably a difference between APIs.
count($view->result); is not the same thing. That's counting the number of items on the current page not the number of items total on all pages. If you have a carousel that has 4 items on the first page but 16 items total, and Views only returns 4 items at a time, then the carousel is not going to show the other 12 items. But again this may be a moot point since AJAX support isn't working yet anyway. :P
Comment #32
quicksketchsnufkin and I figured this one out with a little IRC session. Looks like I just needed to add a few filters to my view to reproduce the problem. The approach I used in #25 probably isn't going to work for Drupal 7. After testing and verifying this new approach works I've committed this patch.
Comment #33
WilliamV commentedThis works like a charm in Internet Explorer 7 & 8 but in Mozilla Firefox the display isn't correct.
Please advise.
Thank you!
Comment #34
quicksketchThis has nothing to do with this issue. This is about getting the Views integration just working. Your comment relates to theming and is too vague to act upon anyway. Please file a new issue.