If you are trying to use i18n and taxonomy access control you will have a problem: both of them try to patch taxonomy.module.
Well, I have done a merge between both, so now you can use i18n and taxonomy access control without trouble.
The instructions are:
1) Install taxonomy access control as usual
2) Install i18n without applying i18n_taxonomy_module.patch, instead, apply the patch that I'm providing
Of course, I will really like if you could review my patch ;-) . I'm almost sure I didn't mistakes, it was easy to merge both patches because, except in one (two?) lines they touched differents parts of code. Anyway, YMMV, use at your own risk.
Comments
Comment #1
jsaints commentedSeems that the file was uploaded incorrectly. When I download it the file is full of html characters. Could you post it again?
Thanks
Jon
Comment #2
jsaints commentedI ran
website/testint/modules$ patch -p0 -b < /home/jons/taxonomy.module.patch_i18n
And got the error
patching file taxonomy.module
patch: **** malformed patch at line 32: function taxonomy_save_term($edit) {
Comment #3
plj commentedHello jsaints,
every 'malformed' error seemed to be because of a missing space (' ') in the beginning of each malformed line. I've included a manually fixed version as attachment (at least it now works for me, but YMMV, of course). Also, unlike miope claims, this patch includes both the i18n path AND the taxonomy_access patch. So use it against vanilla 4.6.0 taxonomy.module.
This really starts to feel like a horrible chewing gum fix, though. I really hope that i18n would be included to the core, so that people wouldn't need to patch everything under the sun to get the functionality.
Comment #4
jose reyero commentedWell, this two patches from different modules not working together is a difficult issue to fix.
So we'll have to wait to see if any of them is committed to core before, so the other will have to update ;-)
All I can do for know is adding a link to this thread in the README file.
Please, people using this patch provide some feedback.
Comment #5
JoranLawrence commentedIf possible, please post or send me your patched version of taxonomy.module.
I don't know if we can start a movement... But I really think i18n should go to core. It is such a valuble module. I feel almost as strongly about taxonomy_access...
However, until they make it to core. I guess we are stuck with the patches. Which is even more troublesome for me because I am stuck in a windows environment and I can't easily run the patch. If possible could someone please post or send me the patched version of taxonomy.module that functions (I can help debug if it doesn't) with i18n and taxonomy_access.
Thank you very much! I really appreciate your efforts on this.
Comment #6
brunodbois it also possible to do it in reverse order?
I've installed i18n already, and applied its taxonomy patch. now I would like to install taxonomy_acces, with the merged patch above. however, in the instructions it says taxonomy_access goes first. plus, the i18n patch was already applied. is there a way to work around this?
(note: I'm not a developer myself.. )
Comment #7
igrcic commentedcan somebody tell me what are experiences with v4.6.5 ? does this patch also works for it?
Comment #8
klance commentedFirst let me thank miope and plj for posting this patch. I originally thought that the taxonomy_menu module didn't work with i18n, when in fact it was the taxonomy_access/i18n patch conflict that was at fault. With only the i18n and taxonomy_access patches installed, taxonomy_menu listed both English and French categories in the site menu, instead of the selected language only. After applying this patch to the original taxonomy.module, both taxonomy_menu and taxonomy_access appear to be working properly.
Now to answer igrcic's question. I just finished integration testing my sites using Drupal 4.6.5 with all of the following modules installed:
Significant to this issue:
- i18n
- taxonomy_menu
- taxonomy_access
Not significant to this issue:
- tinymce
- fckeditor
- gsitemap
- forms
- survey
When I installed miope's patch, I had forgotten to revert to the original taxonomy.module first, and for some reason it executed with no errors. But it didn't really work because taxonomy_menu was still listing both English and French categories when one or the other language was selected. I didn't notice any other symptoms of this patch conflict, by the way. Anyway, once I reverted to the original taxonomy.module, miope's patch failed with errors, so I read further, tried plj's and it worked. Now my 4.6.5 is working properly with i18n, taxonomy_access and taxonomy_menu.
Comment #9
igrcic commentedklance, can you confirm that you dont have issues like in http://drupal.org/node/22345 ?
tnx
Comment #10
js1 commentedThe taxonomy.module doesn't seem to want to be patched. The author of the taxonomy_access module provides a taxonomy.module that has his patch applied to it because people were having so many problems patching that module. Neither of the two i18n patches attached to this thread will patch that pre-patched taxonomy.module file.
Here's the output:
sh-2.05$ patch -p0 -u < taxonomy.module.patch_i18n
patching file `taxonomy.module'
Hunk #1 succeeded at 101 (offset 2 lines).
Hunk #3 succeeded at 193 (offset 2 lines).
Hunk #5 succeeded at 248 (offset 2 lines).
Hunk #6 FAILED at 393.
Hunk #7 succeeded at 422 with fuzz 2 (offset 1 line).
Hunk #8 FAILED at 446.
Hunk #9 succeeded at 472 with fuzz 2 (offset 12 lines).
Hunk #10 FAILED at 482.
Hunk #11 FAILED at 502.
Hunk #12 FAILED at 538.
Hunk #13 FAILED at 566.
Hunk #14 FAILED at 587.
Hunk #15 FAILED at 627.
Hunk #16 FAILED at 666.
Hunk #17 FAILED at 716.
Hunk #18 FAILED at 793.
Hunk #19 FAILED at 819.
Hunk #20 FAILED at 855.
Hunk #21 succeeded at 1133 with fuzz 2 (offset 111 lines).
13 out of 21 hunks FAILED -- saving rejects to taxonomy.module.rej
And, with the second attached patch:
sh-2.05$ patch -p0 -u < ../patches/i18n_AND_taxonomy_access_taxonomy_module.patch
patching file `taxonomy.module'
Hunk #1 succeeded at 101 (offset 2 lines).
Hunk #3 succeeded at 193 (offset 2 lines).
Hunk #5 succeeded at 248 (offset 2 lines).
Hunk #6 FAILED at 393.
Hunk #7 succeeded at 422 with fuzz 2 (offset 1 line).
Hunk #8 FAILED at 446.
Hunk #9 succeeded at 472 with fuzz 2 (offset 12 lines).
Hunk #10 FAILED at 482.
Hunk #11 FAILED at 502.
Hunk #12 FAILED at 538.
Hunk #13 FAILED at 566.
Hunk #14 FAILED at 587.
Hunk #15 FAILED at 627.
Hunk #16 FAILED at 666.
Hunk #17 FAILED at 716.
Hunk #18 FAILED at 793.
Hunk #19 FAILED at 819.
Hunk #20 FAILED at 855.
Hunk #21 succeeded at 1133 with fuzz 2 (offset 111 lines).
13 out of 21 hunks FAILED -- saving rejects to taxonomy.module.rej
The output of the two look similar, as do the .rej file.
As reference, I downloaded the taxonomy_access module from http://drupal.org/project/taxonomy_access. And, I'm running 4.6.5.
Comment #11
js1 commentedThis i18n patch patches the "taxonomy.module.patched" included with TAC.
Comment #12
igrcic commentedjs1, lets clear this out!
first, ure using drupal 4.6.5, right? and you had untouched (unpatched) taxonomy.module ?
if you do then it should say this on the beggining of the taxonomy.module file:
<?php
// $Id: taxonomy.module,v 1.192.2.7 2005-08-24 15:43:04 dries Exp $
then
u download plj's patch http://drupal.org/files/issues/i18n_AND_taxonomy_access_taxonomy_module....
and then patch it:
patch -p0 -u < i18n_AND_taxonomy_access_taxonomy_module.patch --verbose
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- taxonomy.module_ori 2005-05-13 19:25:47.000000000 +0000
|+++ taxonomy.module 2005-05-13 19:25:30.000000000 +0000
--------------------------
Patching file taxonomy.module using Plan A...
Hunk #1 succeeded at 99.
Hunk #2 succeeded at 123.
Hunk #3 succeeded at 191.
Hunk #4 succeeded at 235.
Hunk #5 succeeded at 246.
Hunk #6 succeeded at 391.
Hunk #7 succeeded at 421.
Hunk #8 succeeded at 445.
Hunk #9 succeeded at 460.
Hunk #10 succeeded at 470.
Hunk #11 succeeded at 490.
Hunk #12 succeeded at 526.
Hunk #13 succeeded at 554.
Hunk #14 succeeded at 575.
Hunk #15 succeeded at 615.
Hunk #16 succeeded at 654.
Hunk #17 succeeded at 704.
Hunk #18 succeeded at 781.
Hunk #19 succeeded at 807.
Hunk #20 succeeded at 843.
Hunk #21 succeeded at 1022.
done
Comment #13
igrcic commentedjs1, lets clear this out!
first, ure using drupal 4.6.5, right? and you had untouched (unpatched) taxonomy.module ?
if you do then it should say this on the beggining of the taxonomy.module file:
// $Id: taxonomy.module,v 1.192.2.7 2005-08-24 15:43:04 dries Exp $
then
u download plj's patch http://drupal.org/files/issues/i18n_AND_taxonomy_access_taxonomy_module....
and then patch it:
Are you sure you didnt touch your taxonomy.module before patching it??
Comment #14
mtg commentedI have already searched all of drupal.org, as weel as Reyeros site, and google, trying to find a patch so taxonomy_menu works with i18n (or the other way around).
The problem is well documented: basically, changing languages from i18n block does not bring the taxonomy_menu page for the translated term.
Instead, the same taxonomy_menu page is called, but because its terms are in the prior language and not in the language you just selected, no content is displayed and a message is displayed.
When the regular taxonomy/term pages are used, the i18n block processes the taxonomy/term/xx url and the link in the block is for the translated taxonomy/term/yy page. It seems that this processing in the block is not detecting taxonomy_menu.
I noticed that taxonomy_menu uses a different syntax than taxonomy/term (/aa/bb/cc instead of just cc) and because of this complexity I could not make any progress in my attempt to patch i18n block.
I have tried a workaround with alt urls. For example:
These are the two taxonomy_menu pages that needed to be switched through i18n block:
pt/taxonomy_menu/5/28 (term in Portuguese)
en/taxonomy_menu/5/25 (same term but in English)
i18n block tries to switch languages as follows:
if showing in Portuguese, i18n tries to switch to English as:
pt/taxonomy_menu/5/28 -> en/taxonomy_menu/5/28 (should be .../5/25)
if showing in English, i18n tries to switch to Portguese with:
en/taxonomy_menu/5/25 -> pt/taxonomy_menu/5/25 (should be .../5/28)
So I created these two alt ulrs to work as hooks:
en/taxonomy_menu/5/28 -> en/taxonomy_menu/5/25
pt/taxonomy_menu/5/25 -> pt/taxonomy_menu/5/28
But these won't do the job, because alt urls module does not seem to detect the "en/..." and "pt/..." in the begining of the urls, so the above are never redirected.
BTW, I am using Drupal 4.5.6.
Thanks a lot again for the i18n solution! And thanks again, in advance, hoping you can help us with this issue....
Best regards from Rio de Janeiro!
Comment #15
kje commentedRE 14, mtg: A quick workaround (I use it on my old drupal site):
1. Assign a custom path to "en/mytaxonomymenu" and "pt/mytaxonomymenu" in the path module
2. The term you use for "mytaxonomymenu" must be the same for all langs meaning the same page
3. Repeat for every taxonomy menu
Comment #16
jorditr commentedIs not a ready-to-use patch anywhere? I've found so many patches on this cvs criptic style that I don't know what should I do, I'm not a programmer and I don't understand that cvs and/or sandbox thing. Would it be so difficult to provide a i18n distribution with just-substitute-this-with-that files? It's sad enough that once you realize how wonderful Drupal is realize that the multilanguage support is not on the Drupal core team plans and we have to hack our installations without knowing if future releases will have the support of the person providing that module... Hmmm, well, anyway, is there a ready-to-use patch anywhere?
Comment #17
chx commentedWtih http://drupal.org/diffandpatch the process is nicely documented even on Windows. It's not that big an effort. You do not need to program.
Comment #18
klance commentedThis is a follow-up to igrcic's question (#9).
I was experiencing the problem you mentioned (and others) when I was using the i18n taxonomy patch with the taxonomy_access patch applied over it. When I would switch from one language to another while viewing a taxonomy term, the locale would change, but the term id would not change to the alternate language version.
After applying plj's patch to the original taxonomy.module, it appears to work properly. To clarify, when I'm viewing a taxonomy term and switch languages, the locale changes, as does the term id, to that of the same term in the corresponding language.
Comment #19
klance commented...on the other hand, lgrcic, taxonomy_menu doesn't do what it's supposed to when it comes to switching languages, because it doesn't put the locale in the url of the links it generates to start with:
http://my.domain.com/taxonomy_menu/1/347
When I click on an alternate language link, the locale appears in the URL:
http://my.domain.com/fr/taxonomy_menu/1/347
But taxonomy_menu doesn't correlate the terms properly, so I get the message, "There are currently no posts in this category."
Either way, I've dumped taxonomy_menu since I have no foreseeable need to link to the terms themselves, but rather the nodes with which they're associated.
Comment #20
mtg commentedkje , thanks for the idea, it`s a bit different from what I have tried, so i'll give a try!
taxonomy_menu automates so nicely the process of keeping a menu up-to-date while users dynamically update vocab terms (user is free to update vocab tree, the menu will follow)... imho its a waste if we are to manually keep alt urls for every vocab/term, in every language.......
i18n and taxonomy_menu are both such popular contributions, its incredible that they still didnt get a patch to work together....
Comment #21
mtg commentedDiscussion going on in i18n area, but should be in taxonomy_menu....
Comment #22
brmassa commented