Multilanguage blocks dont work (drupal 4.7). Error: Invalid argument supplied for foreach() in /var/www/asiafan.org/modules/i18n/contrib/i18nblocks.module on line 79.
They still can be created but after that they don't appear on the site if enabled and they can't be deleted any more.
(I have drupal 4.7.2, mysql 4.1.1 and php4 and a fresh install.)

CommentFileSizeAuthor
#17 i18nblocks_0.module4.89 KBtrantt

Comments

asiafan’s picture

edit: multilang. taxonomy blocks doesnt appear but more simple blocks seem to work but still having that error code (above) and with no delete link and no possibility to delete them... any idea about this? I'm afraid to use them like this...

asiafan’s picture

that 79. line is: foreach($module_blocks as $delta => $block) {
any idea?

ica’s picture

Title: multilingual blocks error » multilingual blocks i18nblocks.module on line 79 error

i get the same error
/modules/i18n/contrib/i18nblocks.module on line 79
when i try to >add multilingual block

and i have no idea - just to point that you are not the only one asiafan

asiafan’s picture

thanks.. and have you tried to used them? for me some of them work, I'm just worried about the error message..

trantt’s picture

I'm having the same problem as well. I wish I know php so I can fix it myself.

trantt’s picture

Title: multilingual blocks i18nblocks.module on line 79 error » How to get rid of the 79 warning message

I was able to get rid of this problem by adding the below syxtax:
if (count($module_blocks) > 0) { //--> check to make sure $module_blocks is not emptied
foreach($module_blocks as $delta => $block) {
...
...
}
}

this should do it.

Also, to get rid of the unwanted i18n blocks, I have to do the followings:
1. removed all i18n records from the blocks and the variables table
2. unchecked all of your theme default and pick an new one. Save it and then go back to your original one

If someone knows a better method please let us know.

Thanks

asiafan’s picture

Title: How to get rid of the 79 warning message » How to get rid of the 79 warning in i18n.blocks module

trantt, where did you add this syntax? and then is the module fully functional?

trantt’s picture

Title: How to get rid of the 79 warning in i18n.blocks module » modules\i18n\contrib\i18nblocks.module

asiafan,

The file that you need to change is i18nblocks.module. It located under your modules\i18n\contrib\ folder
Is the module fully functional? I was able to do everything I needed and it is not much different from the privious version (4.6). Regarding to removing an existing i18n block, unless you go behind the scene, I don't think this feature was provided on this release nor the previous release. Let me know if you run into any problem

trantt’s picture

Title: modules\i18n\contrib\i18nblocks.module » syntax

Asiafan,

According to my previous post, you need to do the followings:

1. open the i18nblocks.module
2. Locate foreach($module_blocks as $delta => $block) { --> this is on line 79
3. Add if (count($module_blocks) > 0) { right above of line 79
4. Add the } bracket after the } (few lines down)

This should do it.

asiafan’s picture

Title: syntax » Error in i18n.blocks module on line 79

thanks, now i got rid of the error message...

deleting unwanted blocks also works by deleting from the sql tables but i think its not a nice way to do that and still indicates that something is wrong

and even after this fix, taxonomy blocks cannot be used in multil. blocks module, they dont display. maybe its an unrelated bug.

asiafan’s picture

Title: Error in i18n.blocks module on line 79 » Multilanguage blocks cannot be deleted
trantt’s picture

Title: Multilanguage blocks cannot be deleted » taxonomy block

"taxonomy blocks cannot be used in multil. blocks module" what do you mean by this asiafan? Can you show me how to create a baxonomy blocks (menu I'm assumed) I would like to try it on the older version (4.68). I think this might have been a different issues

asiafan’s picture

Title: taxonomy block » multilanguage block cant be deleted from admin page

i open a new one for the taxonomy problem

trantt’s picture

Title: multilanguage block cant be deleted from admin page » taxonomy's i18nblocks

Asiafan,

I was able to create taxonomy i18nblocks. Here's what I did:

1. Create a menu
2. Attach those taxonomy menu items to the new menu
3. Now include the new menu on your i18nblocks

Is this what you are looking for?

asiafan’s picture

im looking for these two modules to work properly and not to make complicated hacks..

but no, i wasnt looking for a "menu". first, i dont have taxonomy menu module, but nevermind. taxonomy block is not a menu block. it has teaser texts and links to new content within a given category.

asiafan’s picture

Title: taxonomy's i18nblocks » error in i18n.blocks module (fixed) + can't delete multilanguage blocks

and please stop renaming this topic from its original issue. as i told, i opened a separate issue for the taxonomy problem: http://drupal.org/node/72784

trantt’s picture

Title: error in i18n.blocks module (fixed) + can't delete multilanguage blocks » Here is the fix to this problem
StatusFileSize
new4.89 KB

Can someone please review it? This will fix the 'line 79' problem and as well as http://drupal.org/node/72784

asiafan’s picture

Title: Here is the fix to this problem » i18n.blocks module problem fixed

it works, thank you!

now the only question remained is why the block deletion links are missing.

trantt’s picture

Title: i18n.blocks module problem fixed » delete an i18n block

why the deletion links are missing? this because it was never implemented in the first place. I don't know much about php or i18nblock module but I think this should be an easy task. I'll try to look at it when I have some time. Anyway Asiafan, can you help me on my problem http://drupal.org/node/65182#comment-136373 ?

Thanks

jose reyero’s picture

Status: Active » Closed (won't fix)

It is implemented in latest Drupal 5 version...