When trying to translate a node by clicking the "translate" link
I get this error:
****

Fatal error: Cannot use object of type stdClass as array in /modules/localizer/localizer.module on line 1215

****

what is strange, is that it works on a cloned site with the exact same modules installed and a carbon copy of the database

Comments

Roberto Gerola’s picture

Which version are you using ?

Row # 1215 in dev version has nothing to do with node translation.

Styles’s picture

version = "5.x-2.8"

line 1215: if ($item['#type'] == 'fieldset') {

Roberto Gerola’s picture

Please, update to the latest 1.x development version :
http://ftp.osuosl.org/pub/drupal/files/projects/localizer-5.x-1.x-dev.ta...

Styles’s picture

Upgraded...
Good job making your code more php5 compatible

There is still one Hick: Instead of switching from one language to another, it creates seperate nodes that
publish at the same time

For example, when creating a "Page" with "Publish to Frontpage" and then creating the translation, the result is that both show up on the frontpage

Styles’s picture

Another problem with this new dev version is that "field group" titles dont get translated...

Styles’s picture

What about supplying me with the code to fix line 1215, since that version worked better other then the fact that it wasn't working well with php5 ???

Roberto Gerola’s picture

> Another problem with this new dev version is that "field group" titles dont get translated...
Please, this doesn't seem to be a critical bug, only a feature request.

>What about supplying me with the code to fix line 1215, since that version worked
>better other then the fact that it wasn't working well with php5 ???
If you have encountered some problems, open the issues here and I'll see what
is necessary to fix the problems.

Roberto Gerola’s picture

Status: Active » Fixed
Styles’s picture

>>Please, this doesn't seem to be a critical bug, only a feature request.

It is a critical bug, when a feature works on a release, then doesn't work anymore on a newer released... it becomes a bug.

>>If you have encountered some problems, open the issues here and I'll see what
is necessary to fix the problems.

This is the original issue... line 1215 error of localizer.module.
after research, I found out that its a compatibility problem with php 5 and above.

here is a quote from a similar problem on another site

Upgrading to PHP 5
Sat, 09/24/2005 - 17:43 — joshb

I've been working on some Drupal installations the last few days. First off I've started working on the Drupal-CVS version that should soon be Drupal 4.7.

One of the modules I've been working with is publish. The Publish module as it's out in CVS doesn't work well with Drupal-CVS because of changes to the methods for handling nodes. It also has a construct that doesn't work with PHP 5.

The error is "Cannot use object of type stdClass as array". The required change is to change unset ($class['property']); to unset ($class->property);

Roberto Gerola’s picture

> It is a critical bug, when a feature works on a release, then doesn't work
> anymore on a newer released... it becomes a bug.
I've checked the code.
All fieldset titles in localizer options are all using t() function and are fully translatable
through the locale core module (strings translation).
Descriptions are missing the use of t() function and this morning this little issue
has been solved and update committed to cvs.

>This is the original issue... line 1215 error of localizer.module.
Dev version refers to dev version extracted automatically by Drupal.org system
from cvs and not to the particular version you are using on your pc.
If there were changes in the past day on cvs, a new archive is built
automatically.
At now, the dev version for branch 1, at line 1215 has nothing to do with node translation
I've just download the dev 1.x package and at row 1215 there is : return $lang[0];
If you have different instructions, you are not using the current dev version.

Styles’s picture

Ok... but I do have good new for a quick fix of the error:
Fatal error: Cannot use object of type stdClass as array in /modules/localizer/localizer.module on line 1215
on // $Id: localizer.module,v 1.2.2.50 2007/04/04 23:19:57 sun Exp $ version

Goto Line 1215
Change:
if ($item['#type'] == 'fieldset') {
to:
if ($item->type == 'fieldset') {

Abd TADA... it works

Anonymous’s picture

Status: Fixed » Closed (fixed)