I have a page with two quicktabs. I edit the quicktab settings and make the second tab: Default tab.
This does not work. I have to set is as the first tab and then make it default for it to work.
As soon as I try to make the second tab default tab, it just doesn't work. Anyone?

Comments

bhavikshah9’s picture

Issue summary: View changes

I am using 'quicktabs-7.x-3.6'. I have noticed that the default tab setting is not working only for 'ui_tabs' Renderer. When you select any other renderer, default tab setting is working perfectly.

Anyone else having same issue? Does anyone have patch for this?

bhavikshah9’s picture

I have worked on resolving this issue. I have tested and its working fine now. Please review attached patch.

bhavikshah9’s picture

Status: Active » Needs review
cilefen’s picture

@bhavikshah9 As discussed on IRC, this is your first patch contribution. That is great news and I hope you continue.

Having looked at this patch as such, there are a few things you need to do differently.

First, the file you uploaded is a raw file, not a patch. Follow these instructions to create a patch: Making a Drupal patch with Git.

Second, you must make sure you code follows the JavaScript coding standards. PHP code must follow the Coding standards.

You can use the Coder module to scan your code for compliance.

ultimateboy’s picture

Status: Needs review » Needs work

See #4. This is not a properly formatted patch.

bhavikshah9’s picture

StatusFileSize
new569 bytes

With all due respect to @cilefen and @ultimateboy, I have submitted new patch file here.
Thanks a lot @cilefen and @ultimateboy. I have tried to follow the standards this time.
I would like to request you to let me know if still there is some problem with this patch. I will surely take necessary efforts to correct it and submit a fresh patch again.

bhavikshah9’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 6: quicktabs-default-tab-doesnt-work-2112069-6-D7.patch, failed testing.

cilefen’s picture

--- qt_ui_tabs.js	2014-08-05 07:48:02.000000000 +0300
+++ qt_ui_tabs_patched.js	2014-08-05 07:52:49.000000000 +0300

Normally, you would not rename the file in that patch unless that is the intent of the issue. This may be why the patch did not apply. Be sure you create the patch against the development branch, which in this case is 7.x-3.x.

+++ qt_ui_tabs_patched.js	2014-08-05 07:52:49.000000000 +0300
@@ -6,8 +4,9 @@
+				var active_tab = parseInt(settings.quicktabs[qtKey].active_tab);
       if (!settings.quicktabs[qtKey].history) {
-        $(this).tabs();
+					$(this).tabs({selected: active_tab});

The Drupal coding standards specifies spaces, two spaces, not tabs.

bhavikshah9’s picture

StatusFileSize
new508 bytes

Trying one more time.
Heartily thanks to @cilefen for continuous help.

bhavikshah9’s picture

Version: 7.x-3.4 » 7.x-3.x-dev
Status: Needs work » Needs review
cilefen’s picture

This patch does not apply to the 7.x-3.x branch. I recommend reading Making a Drupal Patch.

bhavikshah9’s picture

StatusFileSize
new596 bytes

After @cilefen cleared few doubts, I have created new patch for this.

bhavikshah9’s picture

StatusFileSize
new594 bytes

@cilefen, One last time for the day. Can you please... check it?

The last submitted patch, 13: quicktabs-default-tab-doesnt-work-2112069-13-D7.patch, failed testing.

The last submitted patch, 10: quicktabs-default-tab-doesnt-work-2112069-10-D7.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 14: quicktabs-default-tab-doesnt-work-2112069-14-D7.patch, failed testing.

bhavikshah9’s picture

StatusFileSize
new602 bytes

Here is the patch that resolves the issue.

bhavikshah9’s picture

Status: Needs work » Needs review
bhavikshah9’s picture

Can someone RTBC this?

samvel’s picture

Status: Needs review » Needs work

Not working for me, because there is should be active option instead of selected:
https://api.jqueryui.com/tabs/#option-active

bhavikshah9’s picture

@Samvel: Thanks for your feedback. But, I have tested the patch on simplytest.me. And its working fine for me. Can you please let me know little more details, why its not working for you? May be, you can test the patch on simplytest.me.
Or you want it to be replaced to adhere to the link you have posted?

pallavi_sugandhi’s picture

Status: Needs work » Needs review

I already applied the patch for this related issue please refer this link https://www.drupal.org/node/1570762

samvel’s picture

@bhavikshah9, pallavi_sugandhi answered in https://www.drupal.org/node/1570762 and i found other problem with this patch. After applying this patch access to any tab by direct url (with hash in URL) not work anymore.

samvel’s picture

For me i see temporary solution:

 var active_tab = parseInt(settings.quicktabs[qtKey].active_tab);
      if (!settings.quicktabs[qtKey].history) {
        if (window.location.hash.match('#qt.*') == undefined) {
          $(this).tabs({active: active_tab});
        }
        else {
          $(this).tabs();
        }
      }

May be not temporary :)

smustgrave’s picture

Status: Needs review » Closed (outdated)

With D7 EOL approaching in a month I'm starting to triage the D7 side of quicktabs queue.

If still an issue or needed for 4.0.x (latest branch) feel free to reopen