Closed (fixed)
Project:
Quick Tabs
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Jan 2009 at 12:40 UTC
Updated:
20 Dec 2014 at 03:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Flying Drupalist commentedOh subscribe. Probably the most important thing for me right now.
I anticipate this hugely.
Comment #2
pasquallelittle guide toward the solution, extracted from the panels_views_all_views_render() (panels_views.module)
Comment #3
pingers commentedHopefully I did this right...
This small patch should add this much needed and easy to implement feature :)
Please try it. (See http://drupal.org/patch if you need to learn how to apply it)
Thanks
Comment #4
summit commentedSubscribing, greetings, Martijn
Comment #5
pasqualleIt works but
1. using '%' sign in the view argument makes invalid HTML for the quicktab as it is used for the link id (to load ajax content)
I don't have a good solution for this. Maybe we can use Drupal.settings.quicktabs to pass settings to quicktabs.js (instead of adding it to the link) but it requires a quite large rewrite of the source code.
2. I think the input should be sanitized. check_plain() on arg() or something.. But I am not sure about this.
I would prefer to have the same code as Panels have for displaying the view, and a confirmation that the arg handling is safe (as I do not see where it is sanitized in Panels)
Comment #6
pingers commentedDoh... that's not good.
Here's an update.
Comment #7
pasqualleI think with the new patch views inside ajax quicktabs does not handle args from url
but you are getting close to the solution :)
Comment #8
pingers commentedNothing changed in the argument handling code part - only the addition of str_replace for '%' with 'arg'.
Maybe try downloading the module fresh and applying the patch again.
I can confirm argument handling is still working for me.
Comment #9
pasqualleok, I tested it now. I can tell it does not even worked with the previous patch.
the problem is that the quicktabs.js needs that value what you have changed in the last patch. There must be the exact argument value for that view, otherwise it can't work with an ajax quicktab..
if you put the view on the first tabpage than it will work, as the first tabpage in not an ajax tabpage, it is loaded at page load. Try to move the view to the second tabpage and you will notice that the view does not receive the arg from url..
Comment #10
pingers commentedAh, I wasn't using ajax.
Ok, the solution would be to set a js variable - rather than hacking it out of a css id.
No mucking about that way - I'll fix this when I get a chance.
Cheers!
Comment #11
pingers commentedWell, turns out the js variable was already being set, so I don't know why it wasn't being used over hacking it out of a css id. Eeeek.
Anyway... please try it out.
PS. There was another bug where extra slashes were getting added to the view variable (due to not being emptied for each tab).
Cheers
Comment #12
pasquallethe last patch is strikingly interesting...
I have some questions, as I see you must be quite familiar with Drupal ajax handling:
1. why tab.qtid?
var args = Drupal.settings.views.ajaxViews[tab.qtid].view_args;
I tried to find where is it set in the module, but I can't find a connection. In the _quicktabs_prepare_views() function the qtid is not used.
2. How do you check the values in Drupal.settings? Is it possible with firebug?
Comment #13
pingers commented1. I figured the tab.qtid was the id of the quicktab. (The order in which they appear). If this is incorrect, my apologies.
I'll have to setup a few more tab pages and test more thoroughly... to ensure this is the right variable.
2. Firebug :) Unfortunately you can't see the globals unless you reference them. (not a problem in this case)
How did it work for you?
Comment #14
quioxte commentedseems to be working fine here. thank you thank you and thank you.
Comment #15
mr.andrey commentedI just tested this on a tracker view as a second tab. It picks up the argument correctly and displays tracker for the proper user as tracker/uid would.
Great work!
Best,
Andrey.
Comment #16
katbailey commentedHmm, the method for getting the correct view args from Drupal.settings was not reliable. I have reworked the patch to add the evaluated url args onto the id string of the tab element. It's working for me but I'm aware that different people have different use cases so wanted to throw this up and see if it works for everyone else before committing.
Comment #17
pasqualleI am not sure, but the last patch seems like a possible security hole, as it puts a parameter from url directly into the HTML output within the _quicktabs_construct_tab_attributes() function..
Comment #18
katbailey commentedAh, never thought of that - good catch. Then I guess we're stuck with passing it through Drupal.settings but it may need to just go in Drupal.settings.quicktabs seeing as there's no reliable way to access the correct ajaxView object from Drupal.settings.views.ajaxViews - even checking against the view name and display id isn't reliable because you could have two instances of that exact same view/display with different arguments.
Comment #19
katbailey commentedChanging the status...
Comment #20
pasqualleI would like to see this feature solved in 2.x version, but I am not sure how big the Drupal.settings.quicktabs change would be..
Comment #21
cfmcoder commentedsubscribing
Comment #22
katbailey commentedOK, since getting tab details into Drupal.settings.quicktabs (per #394400: Use Drupal.settings.quicktabs) we now have a reliable way of getting the correct view arguments. The fix committed in http://drupal.org/cvs?commit=184224 is a reworking of pingers' approach using this more reliable method for the ajax views. Please try out the next dev release (should be created a few hours from now) and let me know if there are any issues with this.
Comment #23
pasquallesmall html problem
ID must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
the problematic code inside _quicktabs_construct_link_options() function:
quicktabs.module line 316
I guess the tab link id is not used any more so this code can be removed.
Comment #24
katbailey commentedAh yes, I had got rid of all the other info we'd been putting in there and thought I'd better leave something as I think the element's id is used in the progress-loading js, but forgot there would only be numbers left ;-) I'll add quicktabs-tab- or something to the start of it
Comment #25
pasquallethere is something wrong with view argument handling in ajax loaded tabpages.
the view argument setting is: If the argument is not present then display all values. This setting works with non-ajax quicktab, but with ajax quicktab the view is not displayed if the argument is not provided in the url.
Tried with single and multiple arguments also..
Comment #26
katbailey commentedHmm, I'm not sure how to handle this... need to look into it more.
Comment #27
tayzlor commentedsubscribing
Comment #28
katbailey commentedOK, I've committed a change which I think eliminates problems with non-present arguments from the url (http://drupal.org/cvs?commit=185662). However, during testing I did notice a strange bug with views arguments, which I haven't found a fix for but it is extremely edge-casey:
If you have a QT block with the same view in two tabs but with different arguments, if the second tab rather than the first is loaded on page load (e.g. by accessing it directly with ?quicktabs_0=1 or whatever appended to the path) and it has pager links (ajax-enabled of course), then the pager links mistakenly call the view with the arguments for first tab. However, this second view works perfectly fine if it is loaded via ajax, as it would be under normal circumstances. It also works fine if the QT block is set to non-ajax mode.
Otherwise, I think the arguments are working properly. Please test.
Comment #29
pasquallethe current argument handling was not able to process this type of argument:
it could be a valid list of taxonomy term arguments for the view.
So I replaced the argument handling code with the one used in panels 3, and also replaced the ugly view rendering code:
http://drupal.org/cvs?commit=186444
this still needs testing..
Comment #30
pasquallefixed #24 http://drupal.org/cvs?commit=186452
We should simplify the markup when we move to theme templates..
Comment #31
pasqualleIt seems the only remaining issue here is #25. I need to retest that..
Comment #32
virtualdrupal commentedI'm experiencing the same problem as #25 with the latest Dev of 6.12 x 2.x
I have three tabs, all views blocks that depend on the arg(2); of the taxonomy url to populate the blocks.. Only the 1st tab works, I can't ajax load the other tabs, if I ditch the ajax mode all three tabs populate fine. From what I gather none of the above patches would solve this right, it's next on the list?
Comment #33
pasqualleno there is no patch for #25
Comment #34
giorgio79 commentedsubs
slightly similar as #25
For me only the first tab loads, the rest do not, even if I have the argument in the URL!
This is on plain taxonomy pages, overriden with views. I would show a QT block, but only the first tab loads, even if I pass arg(2) to the block.
Comment #35
pasqualle@giorgio79: please create a new issue, because the taxonomy argument should would.
Comment #36
giorgio79 commentedThanks Pasqualle. Meanwhile I solved my issue at #34. For the second tab I had to pass an argument, but only %2 worked for a taxonomy term ajax quicktab, arg2 or arg1 did not. Thought I post it here now that I solved it instead of a new one.
Comment #37
Flying Drupalist commentedIn my view I have the default arg set as this:
With a relationship of node-reference.
Nothing gets returned on ajax tabs. I think it's part of this issue.
What is this status on here?
Is more information needed or testing needed or something?
Thanks everyone.
Comment #38
pasqualle@Flying Drupalist: this issue is mostly fixed. View args from url works.
But your problem does not seem related, as you are using a default arg, not an arg from url..
Comment #39
crea commentedSubscribing
Comment #40
whiklojsubscribing
Comment #41
webwriter commentedSorry to bump this, but it says fixed... I just downloaded QT today and if I test my QT block as a normal block, %1 works fine for the arguments in my views. However, including that block in a panel returns no content.
Is that a different issue, or related to this one?
Comment #42
pasqualleyes, different issue. Panels argument handling not supported (yet).
Comment #43
wjaspers commentedIn response to #41:
I'm getting a similar result in Views blocks that make up my QuickTabs block.
I'm using Context to add the Quicktabs block to the page (which is working).
The end result is a set of QuickTabs with no contents!
Comment #44
pasquallere #43 see #834638: Views + Context + QuickTabs = Empty Blocks??
Comment #45
BeaPower commentedIm having the same problem, so panels arent supported at all?
Comment #46
BeaPower commentedIm having the same problem, so panels arent supported at all?
Comment #47
madjr commentedsubscribing
also looking for a fix for issue #25
-------
edit:
fixed my issue here :)
#921264: Quicktabs NID to View
a note stating that
"ajax mode may need additional arguments (%N) to pass them from URL to QT to views"
would had been nice :)
Comment #48
notslad commentedNOTE: This problem seems to carry over into the D7 version. Let me know if I should create a new ticket instead.
Same problem here but with 7.x-3.0. I have a view that takes three arguments. QuickTabs needs to supply %1 and %2 arguments from the URL and the third argument is provided on a per tab basis (eg. "%0/%1/lesson-type1" or "%0/%1/lesson-type2").
If I manually specify the views arguments the correct entries for the "Block" version of the view are displayed. If I replace any of those arguments with a %N the view returns no results and I occasionally get the following error in my logs..
Comment #49
bmx269 commentedEither I am having a brain fart, or I am having issues. Prob the last part. I am trying to pass arguments to views, as follows.
From the Taxonomy term page url - http://example.com/toyota/ae86-corolla
from the quicktab - %0/%1/engine
the view is built so that it will read /toyota/ae86-corolla/engine and output content, as the chassis and section are 2 separate vocabularies. I am not sure why I am not getting the results, or how to check if the argument is being passed correctly. Any help is awesome as I am struggling with this. Thanks.
Comment #50
pingers commentedHi bmx269,
What you're asking for is a support request. Please create a new issue for your needs. This issue relates to the creation of the argument handling in the previous version. Resetting version...
Thanks.
Comment #51
netw3rker commented