I can't limit category depth, this variable (site_map_categories_depth) seems to be totally unused, neither to decide what is displayed on the site map, nor to build the taxonomy links (like http://drupal.org/node/483402 could make me fear).

This option could be very useful in a deep taxonomy.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

darrell_ulm’s picture

Status: Active » Closed (duplicate)

This looks like a duplicate to this other issue which has a patch.
See: http://drupal.org/node/1593570

Avorathol’s picture

Status: Closed (duplicate) » Active

You can see that this other issue was mine too, and it's absolutely not the same bug.

The other one is on the false displayed main category count (and I'll repost a fixed patch soon). It's just the number in parenthesis which is false.

This one is on selecting until how many hierarchical levels (or depth) will be displayed in Site Map. 1: Just the first level, 2: its children too, 3: its grand children too,.... 0: all of them ?
In short, this variable (site_map_categories_depth) should do that, but isn't used anywhere in the code.

darrell_ulm’s picture

Avorathol,

OK, I see what you mean, and if you have a patch, then that is certainly accepted in Drupal!

Thank you,

NiR-1’s picture

Hello,

I have a really simple patch :
Modify line 353 :

<?php
$tree = menu_tree_all_data($mid);
?>

by

<?php
$tree = menu_tree_all_data($mid, null, variable_get('site_map_categories_depth', -1));
?>
darrell_ulm’s picture

NiR:

Hey, that looks like it just may work., assuming you are meaning the .module file, where else could that line be, well anywhere really, but makes sense if it is in the .module or an .include.

I'll check it out.

daffodilsoftware’s picture

FileSize
670 bytes

@NiR
The variable site_map_categories_depth is meant for Taxonomy depth but the changes that you recommended are meant for menu depth but that helped me to address this issue. I changed line 516 in .module from

<?php
$tree = taxonomy_get_tree($vid);
?>

to

<?php
$tree = taxonomy_get_tree($vid,0,variable_get('site_map_categories_depth', NULL));
?>

I tested it and it worked.Please test it and provide reviews.

frjo’s picture

Assigned: Unassigned » daffodilsoftware

This looks like a good patch but two spaces is missing:

$tree = taxonomy_get_tree($vid, 0, variable_get('site_map_categories_depth', NULL));
daffodilsoftware’s picture

FileSize
647 bytes

Modified

frjo’s picture

Status: Active » Needs work

Tested this now and the configuration option for depth need to be updated as well. The description is outdated and the default value should change from "all" to NULL.

daffodilsoftware’s picture

Status: Needs work » Needs review
FileSize
1.71 KB

Hi frjo
I modified the default value and also changed the description to
Specify how many subcategories should be included on the categorie page. Leave empty to return all levels.
Note that I added
variable_get('site_map_categories_depth') ? variable_get('site_map_categories_depth') : NULL;
as
variable_get('site_map_categories_depth',NULL) was not working as expected and I think it was taking default value '' rather than NULL

Please test the patch and provide feedback.

darrell_ulm’s picture

Hi daffodil,

Re-rolled this to apply after your prior patch :) -- thanks for that patch also.

Anyone want to test this on the -current - dev release or do you trust me to apply it? :)

Thanks

darrell_ulm’s picture

Hello,

Any other takers on quick testing the patch? @daffodil , could you give it a quick test to make sure it's OK. I'll give you attribution on it of course :) before I apply.

Thanks!

john.oltman’s picture

Issue summary: View changes
Status: Needs review » Fixed

In the new 7.x-1.1 release

Status: Fixed » Closed (fixed)

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

tomyinhauser’s picture

Hi guys, it seems that this issue has not been shipped in 7.x-1.1, as stated in previous comment.

The issue summary shows it is in 7.x-1.x-dev, and in fact I was working with 7.x-1.3 and had to switch to dev version to get the bug fixed.

More than that, filtering fixed issues in versions 7.x-1.1, 7.x-1.2 and 7.x-1.3 brings no results. Are the releases being done properly?