Hi there,

How to reproduce:

  1. fresh install of drupal 7.15 (minimal install)
  2. fresh install of OG-7.x-2.0beta2
  3. as admin, create content type 'gp' which is an og group.
  4. as admin, create content type 'gp_content' which is an og group content.
  5. as admin, create 2 nodes of type 'gp'
  6. as admin, create 2 nodes of type 'gp_content'
  7. as admin, edit your account => no issues
  8. install module i18n_fields
  9. as admin, edit your account => Fatal Error

The error:

Fatal error: Unsupported operand types in drupal/modules/field/modules/options/options.module on line 99
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Norberto Ostallo’s picture

I get the same error using og+i18n modules.

amitaibu’s picture

Project: Organic groups » Internationalization
Version: 7.x-2.0-beta2 » 7.x-1.x-dev
Component: og.module » Fields

I don't think it's OG's error -- why does i18n_field_field_widget_form() try to translate a non-translatable field?

mojiro’s picture

It happens also to me after the latest update of organic groups.
I use i18n too.

amitaibu’s picture

Status: Active » Needs review
FileSize
1.28 KB

I've committed a small fix to OG, and it should be fixed with this patch.

Norberto Ostallo’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #4 solved the problem (it applies to i18n, not OG as stated).

carajito’s picture

The patch #4 solved the problem for me too and like Norberto Ostallo said applie the patch on i18n

Arnion’s picture

Patch in #4 solved this problem in node_form
Notice: Undefined index: #required in options_field_widget_form() (line 79 of /modules/field/modules/options/options.module).
Notice: Undefined index: #entity_type in options_field_widget_form() (line 83 of /modules/field/modules/options/options.module).
Notice: Undefined index: #entity in options_field_widget_form() (line 84 of /modules/field/modules/options/options.module).
but I have other problem. When I change language, the field Groups audience disappears.
This is because, the module Translate Field translates field instance using bundle and field name.

muschpusch’s picture

This also fixes a problem (#1) regarding OG and commerce kickstart

weri’s picture

The patch #4 fixes the mentioned php error.

BenK’s picture

Any chance of this patch getting committed soon?

slowflyer’s picture

@slayer: Install the patch from #4 and change:

foreach ($instance['widget']['i18n_field_callbacks'] as $function) {
      if (!$element) {
        // If element is empty, use the origianl one.
        $element = $original_element;
      }
      $element = $function($form, $form_state, $field, $instance_current, $langcode, $items, $delta, $element);
   

to

foreach ($instance['widget']['i18n_field_callbacks'] as $function) {
      if (!$element) {
        // If element is empty, use the origianl one.
        $element = $original_element;
        $element = $function($form, $form_state, $field, $instance, $langcode, $items, $delta, $element);
      }
      else {
        $element = $function($form, $form_state, $field, $instance_current, $langcode, $items, $delta, $element);
      }
 
Arnion’s picture

Thanks @slowflyer,
But i solved the problem this way:

function my_module_i18n_object_info_alter(&$info) {
  if($info['field_instance']) {
    $info['field_instance']['key'] = array('field_name', 'bundle', 'field_mode');
  }
}

I Don't Know If It's right

Arlina’s picture

Patch in #4 solved the undefined index: #required, #entity_type, #entity in options_field_widget_form() error that appeared in the user/register and admin/people pages. Thanks!

MXT’s picture

I can confirm that patch in #4 resolves the issue, but causes what already mentioned in #7:

When I change language, the field Groups audience disappears.
This is because, the module Translate Field translates field instance using bundle and field name.

Jose Reyero’s picture

Status: Reviewed & tested by the community » Needs review

Not sure about the status of this one. According to #14, #7 this seems to be creating some other issues?

Could someone give it a try with latest og and post and update here?

MXT’s picture

There are other threads pointing here:

  1. http://drupal.org/node/1828868
  2. http://drupal.org/node/1836062

And reading http://drupal.org/node/1836062#comment-6792740 seems that patches #4 + #11 here solves the problem.

I think we need a cumulative patch here and supposedly an opinion by Amitabu.

Jose Reyero’s picture

Priority: Major » Critical

I think what we need to do is to implement some cleaner field translation.
Please give a try to this patch, which should fix all these issues (and some others)
#1875282: Improve field translation by implementing hook_field_widget_form_alter()

Marking as critical for next release.

MXT’s picture

YES! patch suggested in #17 resolves ALL the issues in my case.

Thank you very much Jose!

MXT’s picture

Ooops just tested before test results: actually, switching language to IT, a minor issue with label translation is still present: labels for the second select "Other groups" are not translated and identical to the first select.

MXT’s picture

Ok I've tested last patch in http://drupal.org/node/1875282#comment-6882750

Results:

  1. major issues are resolved
  2. still exists "duplicated label error" (see screnshots in attachment)
Jose Reyero’s picture

Title: Fatal error when trying to edit user account when both og and i18n_fields are installed » Issues with Organic Groups and Field translation (Wrong translation for field title)
Priority: Critical » Minor
Status: Needs review » Needs work

Committed the patch in #17 so the main issue here (fatal error) should be fixed now in dev version (once it gets repackaged).

We still have the issue explained in #20 though, so letting this one open, but updating title and priority.

Jose Reyero’s picture

Status: Needs work » Postponed (maintainer needs more info)

Changing into a question:

We still have the issue explained in #20?

Jose Reyero’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (fixed)

It seems not (no follow up) so closing.

Jamesap’s picture

Status: Closed (fixed) » Needs work

The issue with organic groups reference field cardinality 1, as shown in the images is still there.
Drupal 7.41
Organic Groups 7.x-2.7
I18n 7.x-1.13

BR