I'm missing something -- I'd like to recreate all the Quicktabs I've created on a dev site on the production site. Export is great, but how to import?

great module by the way!

Comments

katbailey’s picture

Category: support » feature

Well, normally you would export them to code - in an implementation of hook_quicktabs_default_quicktabs - then they would automatically get picked up on your production environment. However, I realise this is an oversight as some people will just want to be able to import them directly to the database. Changing this to a feature request for that functionality, though I can't promise I'll get around to it myself any time soon :-/

jami3z’s picture

+ 1

im in version 7 though. But yeah the usual "export" feature that other modules provide is usually so you can then "import" it to recreate it somewhere else. great for this module if it can use that same concept.

pasqualle’s picture

Title: export is nice -- import elsewhere how? » Import quicktabs
Version: 6.x-3.0 » 7.x-3.x-dev
Component: Miscellaneous » Code
pasqualle’s picture

Status: Active » Needs review
StatusFileSize
new5.42 KB

this should work

zloutenka’s picture

StatusFileSize
new3.67 KB

Hi, I applied the patch successfully, but was unable to import a quicktab instance.

Somehow, the $quicktabs object doesn't pass properly and quicktabs_import_form_validate() throws an error.

Notice: Undefined variable: quicktabs in quicktabs_import_form_validate() (line 694 of D:\.....\sites\all\modules\quicktabs\quicktabs.admin.inc).
Unable to interpret quicktabs code.

the text I'm trying to import is attached as a txt file

pasqualle’s picture

try to remove

return $items;

from the end.

note: the quicktabs export is wrong, as it should not contain the $items array.. (new issue)

pasqualle’s picture

zloutenka’s picture

Unfortunately, removing return $items didn't help, nor did removing the rest of $items's occurancies.

vadim.hirbu’s picture

Status: Needs review » Reviewed & tested by the community

Hi, i applied the patch (1263706-Import-quicktabs.patch) successfully.
It's working for me.
Exporting and importing works fine.

vrajak@gmail.com’s picture

This is all great for D7, what about the D6 version? Any chance for a patch there? Many thanks.

aiphes’s picture

is this committed to dev ?
is it possible to import/export quicktabs between D6 to D7 website ? if not does exist a solution ?

thanks

mrgoodcheese’s picture

Version: 7.x-3.x-dev » 7.x-3.4

I applied the patch (1263706-Import-quicktabs.patch), and I see that the code is changed, but I don't see any difference within Quicktabs. Am I missing something? Where is it supposed to show the ability to import? When starting a new Quicktab?

ice70’s picture

hi mrgoodcheese,

you'll have to clear the cache before the import link appears next the 'Add Quicktabs Instance' link

Pasqualle - nice one, thank you, the import patch seems to work a treat :)

Cheers
ice70

swfindlay’s picture

I'm using 7.x-3.6 and the code at 486 in quicktabs.admin.inc has changed (so the first chunk fails to patch).

Is there an update of this patch for 7.x-3.6?

Having taken a quick look at the code it's not clear (to me...a non-professional coder) how to integrate the patch.

Sorry if this is a really basic question.

docans’s picture

Issue summary: View changes

I am also looking for how i can import quicktabs from my dev to production site. But i cant find the import link. Any help

Pablo Gosse’s picture

After an upgrade from 7.x-3.4 I've encountered the same issue using 7.x-3.6. I just updated the code and tested and it appears to be working fine. I'll roll a patch and post here later today.

Pablo Gosse’s picture

Version: 7.x-3.4 » 7.x-3.6
Assigned: Unassigned » Pablo Gosse
Status: Reviewed & tested by the community » Needs work

Updating status and assigning to myself.

Pablo Gosse’s picture

Status: Needs work » Needs review
StatusFileSize
new4.36 KB

An updated patch that works against 7.x-3.6 and 7.x-3.x-dev is attached. Could people please review and test?

Hopefully this can get committed to the next stable release and to dev. This functionality is critical to us as we have non-technical users who administer our Drupal site and need to be able to export/import quicktabs instances through the dev-qa-prod chain.

The patch is in p1 format, but we are a Mercurial shop, so I hope it will work against Git. If not, please let me know and I'll set up a Git environment and roll a new patch.

Pablo Gosse’s picture

Assigned: Pablo Gosse » Unassigned

Updating to unassigned to reflect updated Needs Review status. Apologies for the extra post. Should have made that change when uploading the patch.

Status: Needs review » Needs work

The last submitted patch, 18: update-quicktabs-import.patch, failed testing.

Pablo Gosse’s picture

Status: Needs work » Needs review
StatusFileSize
new3.48 KB

Sincere apologies for the last patch. I inadvertently replaced some code that had changed in 7.x-3.6. I've removed the offending code and updated the patch. I've tested against 7.x-3.6 and it works and the exception that the testing caught should now pass.

I've not tested this patch directly against 7.x-3.x-dev but I just did a diff of the patched 7.x-3.6 and the only differences in quicktabs.admin.inc and quicktabs.module are the code to enable the import.

Pablo

liquidcms’s picture

Status: Needs review » Reviewed & tested by the community

tested. seems to work. thanks. :)

let's get this committed.

The last submitted patch, 4: 1263706-Import-quicktabs.patch, failed testing.

ultimateboy’s picture

Version: 7.x-3.6 » 7.x-3.x-dev
Status: Reviewed & tested by the community » Needs work

Just read through the code, still need to test, but I won't commit with the whitespace issues. Also, I'd like to see function descriptions with the added functions.

Please refer to https://www.drupal.org/coding-standards if you have any questions about coding/whitespace standards.

Pablo Gosse’s picture

Thx for the feedback @ultimateboy. I will take care of that next week and submit an updated patch. I assume the Coder module will help identify these issues? I've just recently started submitting patches so will install it and see the feedback it provides.

Thanks,
Pablo

Pablo Gosse’s picture

Assigned: Unassigned » Pablo Gosse
ultimateboy’s picture

Yes, coder should help you find these.

The biggest whitespace issue that stands out is the use of tabs instead of 2 spaces for indentation. Should be a pretty fast and easy fix.

Looking forward to committing your patch!

Pablo Gosse’s picture

StatusFileSize
new3.5 KB

Coder via drush is freaking awesome :-)

Updated patch with whitespace issues resolved is attached. Tested against 7.x-3.6 and 7.x-3.x-dev. Lots of other issues reported by coder in the updated files, but code affected by this patch is okay as far as I can see (other than one warning about a comment exceeding proper line length).

Thanks for reviewing!

Pablo

Pablo Gosse’s picture

StatusFileSize
new3.89 KB

I had actually submitted another patch to allow overwriting of existing quicktabs on import, but it was failing. I now realize that it was failing because it was attempting to be applied against branches which didn't have code from the previous import patches already applied to it.

I hope it's acceptable that I'm uploading an updated version of the patch from this issue which now contains the code originally in the patch found here https://www.drupal.org/node/2289383. I'm going to close that issue and include a link to this issue.

@ultimateboy, if you could take a look and review that would be much appreciated!

Cheers,
Pablo

dcutri’s picture

How exactly does one implement a patch?

Pablo Gosse’s picture

Pablo Gosse’s picture

Status: Needs work » Needs review
agrozyme’s picture

we can use features for import.
Add this function in quicktabs.module

function quicktabs_features_rebuild($module) {
  $default = features_get_default('quicktabs', $module);

  if (false == $default) {
    return;
  }

  foreach ($default as $item) {
    quicktabs_save($item);
  }
}
nitesh sethia’s picture

Assigned: Pablo Gosse » Unassigned
Status: Needs review » Reviewed & tested by the community

The patch (#1263706: Import quicktabs) works as expected.

It gives you an option to import the Quicktab settings directly.

So changing the status to RTBC.

bgelhard’s picture

Thanks to all for implementing this patch. I've successfully applied it, but I still don't see anyway to import a quicktab. Once the patch is applied, what would the procedure be?

Thanks, Barbara

Pablo Gosse’s picture

Hi Barbara. If the patch applied successfully you should see a link with the text 'Import' next to the 'Add Quicktabs Instance' link. Are you not seeing this?

What version of Quicktabs are you running?

Cheers,
Pablo

bgelhard’s picture

Thanks for your reply and sorry I didn't notice sooner. I am using version 7.x-3.x-dev. I don't see that link next to the link to add a new instance.

Thanks again, Barbara

caspervoogt’s picture

patch from https://www.drupal.org/node/1263706#comment-8961325 looks RTBC from my end. Works.

Pablo Gosse’s picture

Hi Barbara. Sorry for the delayed reply. Were you ever able to get the import functionality working?

Pablo

Jeroen94’s picture

It would be lovely if the working patch is ever committed. Go maintainers!

nwom’s picture

#29 worked perfectly and applied cleanly. Thank you!

nwom’s picture

drupal-son’s picture

Patch #29 applied cleanly to latest 7.x-3.8 version.
CC All was needed to make the Import link visible.

This should be committed to Master branch.

Thanks.

nwom’s picture

Still applies cleanly to newest dev.

capysara’s picture

Status: Reviewed & tested by the community » Closed (outdated)