taxonomy block module (http://drupal.org/node/15192/release) creates blocks based on taxonomy displaying the newest x nodes with a teaser
they work fine as normal blocks but when put into a multilanguage block they never show up on page any more (of course they are activated blocks that should display on the sidebar)
when i go to the configuration page of a previously set multilang block containing two taxonomy blocks (based on language) they appear to be not chosen, so it looks like the multilang block somehow loses its content, somehow it cannot hold taxonomy blocks.

CommentFileSizeAuthor
#2 i18nblocks.module4.89 KBtrantt
#1 taxonomyblock.module9.41 KBtrantt

Comments

trantt’s picture

Title: compatibility problem with taxonomy block module » Got it to work with the i18nblocks module
Category: feature » support
Status: Active » Needs review
StatusFileSize
new9.41 KB

OK, I'm not sure how to explain this but hopefully someone can translate the following to english for me

A dropdown menu will contain a code and decode value (ex. California is the decode value and 'CA' is the code value). When i18nblock populate data for the multilingual dropdown menus, the code values will contain the following:

menu_xxx where menu is the menu type and xxx is a numeric menu node id
taxonomy_block_xxx where taxonomy_block is a taxonomy block type and xxx is a numeric taxonomy id

menu_xxx: let's say menu is the first position and xxx is the second position
taxonomy_block_xxx: from the line above, taxonomy will be the 1st position, block is the 2nd position, and xxx is the 3rd position.

Problem:
When saving a multilingual block to the database, i18nblock.module expected a numeric menu node id/taxonomy block id on the 2nd position of the code value. Since the taxonomy block id was set on the 3rd position, i18nblocks doesn't know what to do with it...

Solution:

a. I renamed taxonomy block module from taxonomy_module to taxonomymodule (this will move the taxonomy block id from 3rd position to the 2nd position taxonomyblock_xxx

b. on the taxonomyblock.module, exept for the taxonomy_block table name, I renamed all other taxonomy_block to taxonomyblock

For those people who was already actived the taxonomy_block module, you also need to do the followings:
1. open the variable table and rename taxonomy_block to taxonomyblock
2. Rename your taxonomy_block folder to taxonomyblock folder
3. Complete step a and b above (or you can use my attached file)

Sorry about my english folks, I wish I can explain it little bit better.

trantt’s picture

Title: Got it to work with the i18nblocks module » Modified i18nblocks.module to handle taxonomy_block.module
StatusFileSize
new4.89 KB

OK, I was able to change the i18nblocks.module to handle taxonomy_block.module (without rename it). Can someone please review what I did? This was my first PHP fixed ever (thanks to google search for the syntax)

asiafan’s picture

thanks, it works! (i dont know if the code is perfect but tried it and its great)

francoud’s picture

It also works for me!

dri@drupal.org’s picture

how many languages are you using?
i tried changing the archives substituting the i18nblocks.modules archive and it didn't work :(
i'm using 8 different languages and might need more!

trantt’s picture

Title: Modified i18nblocks.module to handle taxonomy_block.module » Works for me

What do you mean by 'it doesn't work'? can you give us more information regarding to this matter? I was successfully configured i18nblocks.module (patch version) with 5 different languagues...

dri@drupal.org’s picture

Hi trantt,

when i change from one language to another some nodes that were displayed in th taxonomy block simply disapear.
check out: drica.org/drupal

thanxs!

jax’s picture

Title: Works for me » Modified i18nblocks.module to handle taxonomy_block.module

Resetting title.

jose reyero’s picture

Category: support » feature
Status: Needs review » Needs work

Please, provide actual patch, so I can see what changes

trantt’s picture

original syntax

function i18nblocks_save($edit, $delta){
$block = array('name' => $edit['name']);
foreach($edit['i18nblocks'] as $lang => $path){
list($module, $gamma) = explode('_',$path);
$block[$lang]['module'] = $module;
$block[$lang]['delta'] = $gamma;
}
variable_set('i18nblocks_'.$delta, $block);
}

new syntax:

function i18nblocks_save($edit, $delta){
$block = array('name' => $edit['name']);
foreach($edit['i18nblocks'] as $lang => $path){
$ipos = strrpos($path, '_'); //find last '_' position
$block[$lang]['module'] = substr($path, 0, $ipos);
$block[$lang]['delta'] = substr($path, $ipos + 1);
}
variable_set('i18nblocks_'.$delta, $block);
}

juanfe’s picture

A patch file for this is available at http://drupal.org/node/106831.

jose reyero’s picture

Status: Needs work » Closed (won't fix)

This has been addressed in newer versions (5.x, 6.x) and Drupal 4.7 is not supported anymore. Please, consider upgrading

jazzitup’s picture

Version: 4.7.x-1.x-dev » 5.x-3.x-dev
Category: feature » bug
Status: Closed (won't fix) » Active

I've upgraded my Drupal site to the most recent version and I'm using i18n-5.x-3.x-dev for testing at the moment... The same issue appears to me: I can't move blocks from my regions ("Save Blocks" doesn't work).

jose reyero’s picture