Unless there's some sort of conflict that I am unaware of, I'd say this is a bug.

I've installed Tab Tamer to remove the tabs from all of the pages across the website. It working for everything except for the search pages. You'll see in the attached image that the search pages are the last 3 options, ungrouped. Whenever I change the tabs to hidden, or disabled, and save, they go right back as they were. Even when I try to change the order, nothing happens.

I've tried emptying cache and everything, but it still doesn't change.

Thank you very much.

Comments

mortenson’s picture

same here

pvasener’s picture

StatusFileSize
new542 bytes

Got the same problem and I had a look at the code. There is a bug in the _tabtamer_convert_to_single_array function in the case there is no DEFAULT tab (local task) for a menu. In this case, the $key index is empty instead of having the last_default_path value.

Concerning the 'search' case, there is no default tab because 'search/node' is not default as it's defined with the hook_search hook like any other search type.

So here's a patch which seems to correct the bug but I'm not 100% sure it doesn't have any bad side effects so please test it on your system and review it here.

pvasener’s picture

Status: Active » Needs review
ezra-g’s picture

Assigned: tarekshalaby » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new748 bytes

I did the following functional test of this patch:

Before applying:
- at /admin/settings/tabtamer "search" has no fieldset title
- changed 'enabled' to hidden for 'search/%user'
- click save
- form comes back with setting at 'enabled' - setting not changed

applied patch

- still no search fieldset name
- change search user to hidden
- save settings
- Now search fieldset has title "Search" with setting still set to enabled
- set to hidden again
- search/user now set to hidden and the tab is hidden as expected.
I believe the menu cache was cleared after the initial form submission after applying the patch. This seems RTBC.
Attached is a rerolled minor tweak that changes the $val['type'] == '' check to use empty in case this value is NULL and fixes the spacing of the closing parens per the Drupal coding standards.

I tested this patch with successful results in the same manner as above. Marking RTBC.

charos’s picture

Works here! Maybe commit this patch to CVS?

mattcasey’s picture

thanks everyone the patch works for me :D

jwilde’s picture

this patch does not work with og panels. Since og panels requires a Home tab, hiding it on the og panel removes the edit tab on all pages.

Jim

CccXxx’s picture

This patch also worked for me thanks.

@@ -182,7 +182,7 @@ function _tabtamer_convert_to_single_arr
 
   // If there is a MENU_DEFAULT_LOCAL_TASK at this level then set $last_default_path.
   foreach ($tabs_source as $key => $val) {
-    if (is_array($val) && $val['type'] == MENU_DEFAULT_LOCAL_TASK) {
+    if (is_array($val) && ($val['type'] == MENU_DEFAULT_LOCAL_TASK || empty($val['type']))) {
       $last_default_path = $current_path;
       break;
     }
coreyp_1’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for tracking this down!

Status: Fixed » Closed (fixed)

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

awasson’s picture

Status: Closed (fixed) » Needs review

I just noticed that this patch hasn't made it into the current release of Tab Tamer. The patch works extremely well but I wonder if perhaps this issue should remain an open issue until it is resolved in the release version?

Hanscraft’s picture

Status: Needs review » Reviewed & tested by the community

This worked beautifully! Thank you!

guntherdevisch’s picture

Great! Thanks, hopefully commited in the next version.

Greets,
Gunther

coreyp_1’s picture

Status: Reviewed & tested by the community » Fixed

I'm very, very sorry for the huge delay here... don't know how I overlooked this. It's been sitting in CVS for a long time now. I'm pushing a new version (1.1) which includes this patch as well as a few other fixes and enhancements. Thanks again for the work!

Status: Fixed » Closed (fixed)

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