I tried to use the title for the Name and Description of the Taxonomies.
When i try to use the Entity translation and save a term trnslation i get this error for all the view/edit/translate pages of the term

Error message
EntityMetadataWrapperException: Unable to get the data property format as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 430 of /drupal_path/sites/all/modules/entity/includes/entity.wrapper.inc).

Comments

claudiu.cristea’s picture

Getting the same error.

claudiu.cristea’s picture

I found thet this occur only when the "Description" text area is empty. If you fill something there the error doesn't popup. So there must be a check somewhere in the code but lacks.

claudiu.cristea’s picture

Status: Active » Needs review
StatusFileSize
new1.33 KB

And here's a patch

claudiu.cristea’s picture

Status: Needs review » Needs work

Also this error occur on taxonomy_term entities when the description is replaced and the "Process text" of the description_field is set to "Plain text" and there's a value entered as description.

Don't have time to fix or patch (I'm not using anymore that kind of setting) but I just waned to let you know about the bug.

das-peter’s picture

Status: Needs work » Needs review
StatusFileSize
new843 bytes

This exception is triggered if the content of a "text_with_summary" field replacement is synced into the property - but there is no content available (in the current language).
E.g. if you create a taxonomy term in English, and then you try to edit it in German without an existing German translation, the function title_field_text_with_summary_sync_get() tries to set the, not existing, German description and filter value into the original properties.
I've added a condition which checks if there are usable data before accessing them.

renat’s picture

Das-peter, hi again!
Your patch from #5 works just fine for me.

plach’s picture

Status: Needs review » Fixed
StatusFileSize
new778 bytes

I'm not able to reproduce this, but the check looks good so I committed #5 with an updated comment.

plach’s picture

Status: Fixed » Needs work

We need test coverage for this.

ptaff’s picture

StatusFileSize
new554 bytes

Subscribing; similar problem, even with current -dev version (with comment #7 patch already applied):

EntityMetadataWrapperException: Unknown data property format. in EntityStructureWrapper->getPropertyInfo() (line 328 of .../modules/entity/includes/entity.wrapper.inc).

Exception is thrown from line 132, in function title_field_text_with_summary_sync_get():

$entity->{$format_key} = $wrapper->{$field_name}->format->raw();

Trying to find the culprit, I discovered the $entity_type array passed to the function has an empty entity_type['name_field']['und'][0]['format'].

Patch attached to do that additional check.

plach’s picture

I'm still unable to reproduce the bug. Please someone post the exact steps to, possibily from a clean D7 install.

renat’s picture

Unfortunately I can't post instruction to reproduce this problems on fresh install. First of them appeared (in my case) on the relatively old site with many modules enabled (by the way, earlier there were no problems with term creation, and Title module was there yet). And with current -dev I have no problems, so don't know, what should you do to reproduce ptaff's issue.

das-peter’s picture

Not sure if the problem I just came across has to do with this issue, but it has definitely the potential.

title_entity_language() tries to fetch the language property from the entity. But e.g. taxonomy terms don't have such a property.
For that case the title module falls back to LANGUAGE_NONE.
Unfortunately this conflicts with the fallback/default of entity_translation - thus I've added a check to see if entity_translation can be used for the fallback.

plach’s picture

@das-peter:

This is another issue: originally ET was supposed to integrate with Entity API and provide a language property for any entity it handles. This would avoid the exception here without the need to introduce an explicit dependency. However now we have a couple core issues that need to introduce the concept of entity language:

#1253820: It's impossible to submit no value for a field that has a default value
#1260640: Improve field language API DX

Hence I'm going to deal with this in a different way.

renat’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha1

Looks like patch has gone away from alpha1, so after upgrading I faced the same problem again. Applying patch from #7 still solves it, so, please, consider committing it against this version.

And yes, alpha1 is notably smaller than -dev from 2011-Aug-21, so, probably, not only this patch was lost.

plach’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev

@renat:

Thanks for reporting, alpha2 will be out in minutes with all what was meant to be in alpha1.

vasike’s picture

i can confirm the #9 error but i don't think it's related with the entity translations.
this issue it seems related with taxonomy term reference fields somehow.
in my case it's about a product with title replaced and some term references of taxonomies with custom fields

please, can anyone tell me about this line within the title_field_text_with_summary_sync_get function

$entity->{$format_key} = $wrapper->{$field_name}->format->raw();

what does it suppose to do?

zy’s picture

Can confirm #9 error and patch by pfaff worked.

Not so old but already crowded installation with taxonomy entity translation and taxonomy reference fields (not entity reference fields! - used entity reference on same installation/configuration, but could not wrap my head around usage in views. No errors though).

The error did not show up with initial config but after trying to change format to "plain text" for taxonomy description field.
Using WYSIWYG - can it be the reason, or at least adding upp to the problem?

plach’s picture

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

Would you please see if the latest dev fixes the issue?

steinmb’s picture

Tested with latest dev. No error messages of any kind.

plach’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Ok, thanks.

siggi_hrafn’s picture

Issue summary: View changes

I get a failed warning on patching title.module with #12 patch in terminal on mac. Seems like the function has a different line number my title.module file

Here is the terminal output:

Siggi-Mac:modules sigurdurhrafnthorkelsson$ cd title
Siggi-Mac:title sigurdurhrafnthorkelsson$ patch < title-integrate-better-with-entity-translation-1210670-12.patch
patching file title.module
Hunk #1 FAILED at 445.
1 out of 1 hunk FAILED -- saving rejects to file title.module.rej

title.module ->function:

459 - function title_entity_language($entity_type, $entity) {
460 - if (module_exists('entity_translation') && entity_translation_enabled($entity_type)) {
461 -  $handler = entity_translation_get_handler($entity_type, $entity, TRUE);
462 -   $langcode = $handler->getLanguage();
463 - }
464 - else {
465 -   $langcode = entity_language($entity_type, $entity);
466 -}
467 - return !empty($langcode) ? $langcode : LANGUAGE_NONE;
468-}

I'm not a programmer ;) Where should the patch + lines added in this function?

  • Commit 4354632 on 7.x-1.x, workbench authored by das-peter, committed by plach:
    Issue #1210670 by claudiu.cristea, das-peter | vasike: Fixed Entity...
chidosoft’s picture

pls I have this problem EntityMetadataWrapperException: Unable to get the data property format as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 438of /home/www/imydomainname.com/sites/all/modules/entity/includes/entity.wrapper.inc).

pls tell me how you where able to resolve it