Hi,

currently i18n taxonomy overrides the field definition from Taxonomy Term Reference fields and takes over all field hooks from taxonomy module. This architecture has some drawbacks.

Contrib does not know about this "hack" and code like $field['module'] == 'taxonomy' will fail.

Related Issues:
#1172116: Missing filter: taxonomy fields

Maybe there are some more issues in other modules ...

We could fix this issue and provide views integration for this faux taxonomy fields or refactor some code from i18n_taxonomy and switch back to original taxonomy fields. Either way i would work on this issue.

Cheers,
Florian

Comments

webflo’s picture

Component: Blocks » Taxonomy
webflo’s picture

StatusFileSize
new9.25 KB
jose reyero’s picture

Priority: Normal » Major
Status: Active » Needs review

I agree this is a much better approach, so giving a try to this patch.

(I think the main reason why we went for the current approach was not being able to handle the options callback for pre-existing fields. This seems to be fixed by the 'enable' trick now).

On a first test, getting these errors after applying the patch, still doing some more research:

Notice: Undefined index: taxonomy_term in i18n_taxonomy_field_formatter_view() (line 206 of /var/workspace/drupal7/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module).
EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7409 of /var/workspace/drupal7/includes/common.inc).

jose reyero’s picture

One more error, when disabling the module after applying this patch.

FieldUpdateForbiddenException: field_sql_storage cannot change the schema for an existing field with data. in field_sql_storage_field_update_forbid() (line 229 of /var/workspace/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.module).

jose reyero’s picture

StatusFileSize
new9.11 KB

I think I've got it, see new patch.

It just adds back i18n_taxonomy_field_formatter_prepare_view()

@webflo,
It it works for you, just commit.

jose reyero’s picture

Status: Needs review » Needs work

It breaks some test (Synchronize translations) atm:

Fatal error: Call to undefined function i18n_taxonomy_field_prepare_translation() in /var/workspace/drupal7/sites/all/modules/i18n/i18n_sync/i18n_sync.module on line 317

jose reyero’s picture

Status: Needs work » Fixed
StatusFileSize
new9.33 KB

Fixed last issue and committed. This is the patch that got committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.