Closed (fixed)
Project:
Quick Tabs
Version:
8.x-3.0-alpha1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Apr 2017 at 08:47 UTC
Updated:
28 Dec 2020 at 23:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sachandI have fixed this issue , it seems that its missed whie porting to D8 Version . working on patch will upload here soon.
Comment #3
sachandHere is the patch that resolves the issue of argument passing to quicktabs and directly loading particular tab from the url.
to load particular tab use qt-quicktab instance name= tab number (e.g. www.mysite.com/?qt-mytab=1).
Comment #4
sachandComment #6
sachandComment #7
sachandComment #8
sachandComment #9
ErnoVanhala commentedMy original problem was not the "active tab", but the argument to views. But it was already fixed earlier.
Then again this was another problem and this patch seems to fix "go directly to a specific tab", so thank you for that!
Comment #10
andkar commentedWhen I load a view with ajax that uses argument the patch #7 doesn't work. The reason is that current path is the path of the ajax route and we can’t use that for extracting the arguments we need. I have modified the patch to use $_SERVER[’HTTP_REFERER'] to get the arguments when ajax is used.
Comment #11
oeklesund commentedImproved the patch #10 to strip language prefixes in the url, allowing the use of the same offset with or without that language prefix.
Comment #12
oeklesund commentedFixing typo.
Comment #13
oeklesund commentedComment #14
marassa commentedThe patch works fine, but the first argument, like '333' in '/node/333' is matched to %2, because %0 is '' and %1 is 'node'. This is confusing and totally impossible to figure out from the docs until you look in the code and see the
$url_args = explode('/', $current_path);Is it by design? Are there any real-life situations where the argument does not follow '/node/' or '/user/' or whatever, so that we can't just drop the first two elements?
Comment #15
scottsawyerThis patch works great, thank you. Can we mark it RTBC?
Comment #16
lnunesbrPatch #12 works just fine.
Comment #17
manuel garcia commentedShould we be using
\Drupal::request()->server->get('HTTP_REFERER')instead?Comment #18
shelaneI have rerolled the patch with the request service.
Since there are no tests covering this, I would appreciate anyone being able to test it against with their use cases.
Comment #19
shelaneComment #20
manuel garcia commentedThank you @shelane for pushing this forward.
I wanted to note that any class extending ViewContent would have to be updated with this change, but I doubt anyone is doing so.
Looks to me that it could be that
$refereris not set which would result in a PHP Notice.Comment #21
shelaneAh yes. I meant to put a check in later for isset. Nice catch. I’ll update the patch shortly.
Comment #22
shelaneHere is a better refactor of that.
Comment #23
shelaneComment #24
shelaneComment #25
scottsawyerPatch in #22 does not apply to dev-3.x e8cae4a. Not sure why yet.
Comment #26
shelaneThere have been significant code code changes with more to come. So, this is on my list to come back to after I get some other major issues fixed.
Comment #27
shelaneComment #28
loze commentedThe patch didn't quite work for me without a few tweaks.
Here is what I had to do to get views tabs working with arguments.
Comment #29
loze commentedComment #31
shelanePatch at 28 ignores all the changes for dependency injection from the previous patch. I'm going to have to manually review the differences.
Comment #32
loze commentedYea, I couldn't get the dependency injection working. That's where it was failing for me and no matter what I tried I couldn't get the dependencies to be available in the class. I'm probably overlooking something simple, as I'm still trying to wrap my head around how that all works in D8.
Comment #33
shelanePatch 28 needs more work. When there is no QuickTabs yet created, this error is generated on the /admin/structure/quicktabs/add page:
Notice: Undefined index: type in Drupal\quicktabs\Plugin\TabType\ViewContent->optionsForm() (line 30 of modules/custom/quicktabs/src/Plugin/TabType/ViewContent.php).
Comment #34
loze commentedThis is what got views arguments working properly for me.
Comment #35
loze commentedComment #37
shelane