01. fixed: code style
02. fixed: php doc
03. fixed: PHP notices
04. new: better functions to list enabled views and view displays
05. new: created %quicktabs wildcard in the menu
06. new: differnt style for different QTabs (still not possible to show different QTabs on the same page, that would require a change in the styles)
07. fixed: invalid XHTML on admin/settings/quicktabs
08. new: create QTabs with quicktabs_render()
09. new: the quicktabs preview changed from hardcoded to quicktabs_render() function
10. new: less tab data saved into db
11. new: node, block and view can be a tabpage for ajax and non ajax tabpages also
12: fix: removed code duplication (there is absolutely no difference between ajax and non ajax QTabs admin interface, just a single flag)
13. fix: hook_quicktabs_tabstyles() moved back to the module file
14: fix: QT db insert for postgresql
15: fix: t() calls removed from schema descriptions #332123: Remove t() from all schema descriptions

and other small changes

I did not make some changes for a reason to have smaller (more readable) patch
todo:
01. please fix the indentation in hook_menu

note:
The ajax views inside ajax quicktabs does not seems to work, but I did not change that. It does not either work for me without this patch.

Comments

pasqualle’s picture

The patched module can be downloaded from here:

EDIT: download location removed, use the latest release

katbailey’s picture

Title: various improvement and fixes » various improvements and fixes

Hi Pasqualle,
thanks for this - I look forward to reviewing ;-)
Regarding the ajax views not working - did you clear your cache? I have it working pretty well on my demo site: http://64.55.119.4/

Katherine

panji’s picture

wow,.. nice news... thanks,... is the patch already included on the latest dev release?

pasqualle’s picture

@panji: no, it's not (yet). If you would like to test the patch you can (apply the patch to the latest dev version or) download the patched version from my site..

katbailey’s picture

This is far too much for just one patch and should be divided up into separate issues as follows:
- issues 1 through 5 and issues 7, 13 and 15 can probably be lumped together as one patch
- number 6 is a feature that has been requested here: http://drupal.org/node/330042 - please submit a patch to this thread
- 8 and 9 can go together
- 10, separate patch
- 11, separate patch
- 12, separate patch
- 14, this is a bug that has been reported here: http://drupal.org/node/329582 please submit a patch to this thread

I realise that you can't create all these separate patches at once because there is overlap and you'd end up patching against old code that is (hopefully) about to be changed by another patch. But changes like this have to be done piecemeal and if you can break them down like this, start with a couple that are sensible to start with, I will try to keep up by reviewing and committing so that you can roll further patches against updated code from cvs.

thanks,
Katherine

pasqualle’s picture

StatusFileSize
new26.89 KB

OK, the first patch
This is PHPdoc and code style fix only, no functional changes.

Please commit, because I can not continue rolling patches without this. Thanks.

panji’s picture

Great work Katbailey and Pasqualle, the full patched version work fine for me, but we should delete all previous QT block, and creating new one...
anyway QT is a must have module...
thanks..

katbailey’s picture

Phew - that one was easier!
Committed.
Looking forward to the next

thanks,
Katherine

pasqualle’s picture

StatusFileSize
new3.17 KB

this patch is
04. new: better functions to list enabled views and view displays

pasqualle’s picture

StatusFileSize
new2.05 KB

please commit the previous patch in #9 before this, otherwise I'll have to reroll this patch. Thanks..

a) this patch uses $form_state['clicked_button'] in validation and submit handler to determine the clicked button
b) php notice fix: adds validation to check at least one tab is created

pasqualle’s picture

StatusFileSize
new1.28 KB

please commit patch #9 and #10 first

this patch does this: #338021: quick tab edit link is on wrong place
I rather made the patch here, because I fear the commit sequence will be mixed, and I'll have to reroll all my patches..

pasqualle’s picture

StatusFileSize
new2.5 KB

this patch does not depends on previous patches, commit anytime

this patch improves the theme_quicktabs_tabs() function

a) fix php notice and code style
b) add first and last class (note: $index and $i does not have to be equal. This change is not included in my downloadable package (yet), and I think that is why my ajax views does not work inside ajax tabs)
c) removes views module warning (it can't be displayed here, not enough space)
d) uses the drupal_attributes() function

pasqualle’s picture

StatusFileSize
new3.75 KB

please commit this patch after #12

a) this patch add missing file parameters in hook_theme
b) code style and translation string fixes in hook_menu

pasqualle’s picture

no more possible patches for now..

pasqualle’s picture

I have made the noted changes #12 in my release on my site and also changed the version string, so people using my release are always warned that they are not using the recommended version..
Now the ajax views inside ajax quicktabs works, but only if the view is on the first tab and there are no other views on the page. Will try to investigate it later with a new issue after this one is fixed..

katbailey’s picture

#9 committed

katbailey’s picture

#10 committed

katbailey’s picture

#11 committed

katbailey’s picture

#12 committed

katbailey’s picture

After applying the patch in #13 I get the following error on every page:
"warning: array_merge_recursive() [function.array-merge-recursive]: recursion detected in /Applications/MAMP/htdocs/drupal-6.6/includes/common.inc on line 2076."

pasqualle’s picture

can you try to delete the theme cache?

katbailey’s picture

I'm using devel module and running devel/cache/clear but still getting the error.

pasqualle’s picture

I tried the CVS version + patch#13 on a fresh drupal6-dev install and I do not see the that warning..

pasqualle’s picture

If you can find the problem then you can move the quicktabs_quicktabs_tabstyles() function from the admin.inc file to the .module file. Hook implementations should be in the .module file. I can not make a proper patch for that now..

katbailey’s picture

OK, #13 committed - the error went away after I deleted one of my qt blocks, I did more testing, creating more blocks with multiple ajax views (which I had assumed was the problem) and couldn't reproduce it.

katbailey’s picture

#24 done

pasqualle’s picture

StatusFileSize
new7.65 KB

this patch creates a %quicktabs wildcard (replaces 3 db queries with 1)

menu rebuild is required, which can be done by visiting admin/build/modules and clicking on the 'Save configuration' button.

panji’s picture

yess.... it's getting better and better.. keep up the great work..

katbailey’s picture

#27 committed

pasqualle’s picture

StatusFileSize
new2.27 KB

this patch moves some code from quicktabs_block() function into new functions: quicktabs_render() and quicktabs_ajax_render()

this will allow to create quicktabs with some php code, without using the blocks functionality or without storing them into db (for non ajax quictabs)

please fix the indentation in the new functions after applying the patch (I did not fix that for the reason to have the patch small and reviewable)

pasqualle’s picture

StatusFileSize
new1.32 KB

this patch fixes postgresql db insert

pasqualle’s picture

StatusFileSize
new1.4 KB

please commit after #31

this patch fixes php notices in qt_more_tabs_submit() and qt_remove_tab_submit()

katbailey’s picture

#30, #31, #32 committed

pasqualle’s picture

this patch creates a new function quicktabs_render_tabpage() for general tabpage rendering, which opens the possibility to dynamically create tabpages, and to have one theme function for the tabpages later. The code is moved from the functions quicktabs_render() and quicktabs_ajax_render().

and also this patch adds a quicktabs_ajax_block() function and quicktabs/ajax/block menu callback, which is a preparation (for the next larger patch) to have all tab types (node, block, view) for ajax and non ajax quicktabs..

pasqualle’s picture

StatusFileSize
new5.63 KB

and the patch

pasqualle’s picture

StatusFileSize
new2.34 KB

this patch
1. removes a comment and an unused variable from quicktabs_settings_submit()
2. small code style changes and php notice fixes

katbailey’s picture

#35 committed. There was a slight problem which was due to the fact that the id for the node/block/view in a tab page has a different key depending on whether it's an ajax QT or non-ajax. This is because originally the key was 'bvid' - b for 'block' and v for 'view', because it could be an id of either type. Then with ajax QTs I obviously got confused - logically it would have been nvid - n for 'node' and v for 'view' because it could be the id of either a node or a view, but I got mixed up and did bnid :-P Anyway, clearly the key should be the same no matter what. For now I've added in a fix (lines 424 to 429) but once the tab rendering functionality is finalised (i.e. after the larger patch you mentioned above which allows ajax blocks etc) we can think about whether it will be possible to change this without breaking people's existing QT blocks.

katbailey’s picture

#36 committed

pasqualle’s picture

StatusFileSize
new35.9 KB

this patch
1. unifies the admin interface for non ajax and ajax quicktabs
2. changes the format how tabpages are stored + update from the old format (run update.php)
3. fixes some php notices

katbailey’s picture

Hi Pasqualle,
you now have cvs access on Quick Tabs. If you want you can go ahead and commit this patch, it looks great to me though I haven't had a chance to test it and won't until tomorrow night at the earliest.

Katherine

pasqualle’s picture

Thanks, I will do that..
can I finish the other problems mentioned in this issue, or would you like to discuss every change I would like to do in the module?

pasqualle’s picture

#39 committed

pasqualle’s picture

Status: Needs review » Active

http://drupal.org/cvs?commit=156676

1. last bnid value fixed
2. using the function request_uri() instead $_SERVER['REQUEST_URI']

katbailey’s picture

Status: Active » Needs review

Yes, I approve of all the changes in this issue so you can go ahead.
In general, if you want to make changes, if they are just fixes - bug fixes, code style, refactoring for efficiency and removing duplication, etc, - then absolutely go ahead and make changes. But certainly anything on the scale of patch #39 I would like to know about in advance ;-)

katbailey’s picture

Status: Needs review » Active

oops, replied at the same time as you so overwrote your status change

pasqualle’s picture

http://drupal.org/cvs?commit=156681

1. fixed the menu path structure. The breadcrumb and local tasks are displayed correctly now.
2. unified the 'add' and 'edit' quicktabs functions

don't forget to rebuild the menu..

pasqualle’s picture

Thanks again Katherine. I definitely do not plan anything on the scale of this issue, and I will ask you to review every larger feature request before I would commit it.

katbailey’s picture

No, THANK YOU!! you've made some amazing changes and totally cleaned up the code, it's wonderful - great to have you on board! :-)

pasqualle’s picture

http://drupal.org/cvs?commit=156697

1. fixed views block in quicktab. the views blocks have - (hyphen) in the block id, so I simply changed the ajax quicktab to use 2 --
2. fixed two php notices

panji’s picture

some report here:
- it is needed to reset and recreate again the QT block after I update to the latest 6.x-2.x-dev version (4 Dec 08), but it's fine with many change on QT.
- Ajax call on editing QT block especially on creating views tab, make me work slower and sometime made some error.
- I' think it's better to make QT style a little bit narrow on css style and using a little bit smaller font by the default. (minor)

Thanks again for this nice module, Great job,..

Panji

pasqualle’s picture

the update should be fine from the QT 6.x-1.x (and beta) and 6.x-2.x versions (just run update.php and your blocks should be updated), the only problem is when you used my version from my site (there is no update for that, and I do not plan to make). If you could test the update, that would be a help. If there are remaining problems, I could still fix it and make it easier for others..

@panji: Please create new issues for the the remaining 3. I would like to fix those, but it is outside of this issue. Thanks..

pasqualle’s picture

http://drupal.org/cvs?commit=156803

1. node selection changed to inserting node ID into textbox (views uses the same method) instead of selecting it from dropdown
2. teaser and hide title settings for node

pasqualle’s picture

http://drupal.org/cvs?commit=156846

the admin form was messed up if the form validation fails, the js and css files have to be added in the theme function..

pasqualle’s picture

http://drupal.org/cvs?commit=156850

the permissions changed
only 'administer quicktabs' permission is required to add, edit, delete, clone quicktabs.

menu rebuild is necessary

pasqualle’s picture

Status: Active » Needs work
Index: includes/admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/quicktabs/includes/Attic/admin.inc,v
retrieving revision 1.1.2.20
diff -u -p -r1.1.2.20 admin.inc
--- includes/admin.inc	4 Dec 2008 17:08:15 -0000	1.1.2.20
+++ includes/admin.inc	4 Dec 2008 17:09:08 -0000
@@ -426,7 +426,7 @@ function quicktabs_form_submit($form, &$
       quicktabs_createblock($quicktabs);
       drupal_set_message(t('Your Quick Tabs block has been created and can now be enabled.'));
     }
-    drupal_goto('admin/build/quicktabs');
+    $form_state['redirect'] = 'admin/build/quicktabs';
   }
 }

@Katherine: this patch does not work. I would like to change the drupal_goto() to redirect but it sometimes fails, and I do not understand why. Maybe you could help me fix this.

if I just click save, then it works fine
but if I click add tab->save->(validation fail) fill title->save I will be redirected to quictabs/ahah where json data is displayed

pasqualle’s picture

Status: Needs work » Needs review
StatusFileSize
new993 bytes
@@ -373,7 +373,7 @@ function quicktabs_ahah() {
   $args = $form['#parameters'];
   $form_id = array_shift($args);
   $form['#post'] = $_POST;
-  $form['#redirect'] = FALSE;
+  //$form['#redirect'] = FALSE;
   $form['#programmed'] = FALSE;
   $form_state['post'] = $_POST;
   drupal_process_form($form_id, $form, $form_state);

if I remove the $form['#redirect'] from quicktabs_ahah() it seems working. Is it ok to remove it?

pasqualle’s picture

I will not make the style selection option in this issue, as it is not a perfect solution yet.
it will be done in #275232: Different styling for different QTabs

katbailey’s picture

@Pasqualle, removing $form['#redirect'] = FALSE prevents this from happening only if the user doesn't add another element to the form - I tried it, it only pushes the problem further down the line.
It is strange that this happens only after a failed validation. I've done some playing around but haven't found a solution so I've asked chx for help as he might have come across this before.

katbailey’s picture

Status: Needs review » Needs work
pasqualle’s picture

http://drupal.org/cvs?commit=157382

style settings cleanup:
fixed invalid XHTML on admin/settings/quicktabs
the quicktabs preview changed from hardcoded to quicktabs_render() function
theme function prepared for the different style per QTabs functionality

you need to reset your default style and clear the theme cache..

panji’s picture

think it would be better if it is not automatically go back to the list QT display after we save on edit or create QT block IMHO

pasqualle’s picture

addition to #55

I can display json data with the current code also.

click add tab->click save->(validation fail, but just leave it like that)->click save again
results in a redirect to quictabs/ahah where json data is displayed

pasqualle’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.