Closed (fixed)
Project:
Category
Version:
4.7.x-1.x-dev
Component:
Wrapper modules
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
20 Jul 2006 at 12:35 UTC
Updated:
3 Oct 2006 at 06:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
karens commentedFound a bug in the taxonomy wrapper that was returning the wrong value to views when displaying any taxonomy link, including terms (all terms) and terms (my term). I compared what the category module taxonomy wrapper was returning compared to what the original taxonomy module was returning and made the attached fix which gets everything working right. I am pretty sure this will fix the problem and not break anything else, but it would be good for others to confirm that.
Comment #2
marcoBauli commentedKarenS, thanks, applied the patch and works sweet now!
Also that patch on my comment above (an extra category_views_integration.module actually) solved the problem, but this is much cleaner and is always good to turn another mod off ;)
Comment #3
venkat-rk commentedkiteatlas, are you saying that this patch makes that other one unnecessary? I thought that other patch made a fuller integration with views module possible. Sure, you can always generate a view using taxonomy terms as the wrapper module maintains the term data in the table anyway, but isn't it nicer to have category appear on its own on the views module form page?
I am asking because I really don't know.
Comment #4
marcoBauli commentedwell, i switched off the category_views_integration module and applied KarenS patch and my views that use 'Term' as fields or arguments work just fine...!
so looks to me that when it comes to modules, less really is more in terms of speed (less php queries) and tidyness (less menus, modules listed on mods page, ..).
The Taxonomy wrapper is the guy supposed to take care of Category integration, so i prefer not to enable yet another module just to fill a hole that a patch can solve...
Yep, i understand how hard is for Category lovers to see it always in the shade of the elder brother Taxonomy, but in the end untill others will understand it's real goodnes it just takes to remember that "categories" are "terms" and "containers" are "vocabularies" ;)
Comment #5
karens commentedDon't lose sight of the fact that the taxomony wrapper is actually broken and needs this patch anyway. This is not a feature addition, it's a bug fix. The unpatched wrapper returns something totally different than the regular taxonomy module, which it should not do. Views may not be the only module that is affected, it's just the only one I have run into so far.
The question of whether this is all you need depends on whether or not you are using the wrapper. If so, the patched wrapper may suffice. If not, you may need the other module.
Comment #6
venkat-rk commentedThanks! It seems almost certain that Jaza will commit your patch when he returns from vacation.
It does seem redundant to use the views_integration patch if your patch for taxonomy wrapper provides the same functionality by way of a bug fix. I suppose one could say that a more robust module is better than merely having 'category' or 'container' show up in the views form instead of taxonomy.
It wasn't quite clear, though, if you meant to say that it ISN'T necessary to use the taxo_wrapper module for using taxo based modules together with category. Or, did I misunderstand you?
Comment #7
karens commentedNo, I was just saying not everyone is using the wrapper. If you want Views to pick up categories and treat them like terms, I think you'll need the wrapper. If you don't use the wrapper I don't know what you'll get (I am using it so I don't know what happens if you don't use it.)
Comment #8
vatavale commentedI use following snippet for links in links.tpl.php
and i have next warning in each page:
Comment #9
venkat-rk commented@KarenS: Thanks for the clarification:-)
Comment #10
Jaza commented@KarenS: thanks for the patch!
You are right that your patch does the job. However, it doesn't take the right approach in fixing the problem. The role of the taxonomy wrapper is to provide a compatibility layer between taxonomy and category. This means that functions within the taxonomy wrapper should call their equivalent functions in the category module, and should make any adjustments to the format of passed-in arguments before calling these equivalent functions.
Your patch fixes the problem by bypassing the category_link() function in the category module, and by letting the taxonomy wrapper handle the link generation directly. This goes against the philosophy of a 'wrapper'. What happens when the format of links change in Drupal (as they have/will for HEAD/4.8)? If you're bypassing the category_link() function, and providing duplicate functionality in the taxonomy wrapper's taxonomy_link() function, then there will be 2 functions instead of 1 that need to be updated for the next version of Drupal.
Attached patch fixes the problem, by converting the data to a format that category_link() understands, and hence allowing the taxonomy wrapper to rely on category_link() for doing its job properly. This patch has been tested with category_views: before being applied, no 'taxonomy: terms for [container x]' links appear in category_views listings; and after being applied, the links appear just fine.
Patch committed to HEAD and 4.7 branches of category.
Comment #11
karens commentedI'm not surprised to find there is a better way to do it. I quit looking once I found something that worked :-)
Comment #12
vatavale commentedAfter installing new cvs version of Category module (with this long-awaited patch), the links to categories (at top of the node) display double time on every node.
Comment #13
venkat-rk commentedYou are right. I just downloaded and installed category with the wrapper enabled and there are two links for every category.
Comment #14
volunteermama commentedMaybe this is causing my issue too.... each item that is catagorized .... shows each catagory twice. (forgive my newbie mis use of terms)....
http://happybabieshappymoms.com/
Comment #15
bdragon commentedgerd riesselmann points out in
http://drupal.org/node/83496
that $cid is not initialized in the patch.
(pointing 83496 to this issue)
Comment #16
bdragon commentedComment #17
catchIs this a duplicate:
http://drupal.org/node/83490
I don't use category module, but am having the same problem with taxonomy terms for [vocabulary] intermittently - it disappeards from the filters list quite often.
Comment #18
bdragon commentedAssigning to self. Marking this as the master issue for the taxonomy_link() $cid bug.
Please excuse the deluge.
Thank you for your patience.
--Brandon
Comment #19
bdragon commentedThe following issues have been marked as duplicates.
http://drupal.org/node/79610
http://drupal.org/node/79890
Comment #20
Jaza commentedFix for the duplicate category labels problem committed to HEAD and 4.7.
Comment #21
vatavale commentedOk in CVS, but in 4.7 problem remain.
Comment #22
vatavale commentedi mean duplicate category labels problem
Comment #23
bdragon commentedDid you remember to disable and reenable the wrapper?
The actual changed file is in wrappers/taxonomy.module.copyme, it won't reinstall itself....
Comment #24
vatavale commentedLook strange. Yes, i think i did it yesterday :) but today, after your post, i rechek and... it works. Sorry.
Comment #25
(not verified) commented