I was getting this error upon trying to edit a simple node that belongs to a workflow
EntityMetadataWrapperException: Unknown data property . in EntityStructureWrapper->getPropertyInfo() (line 351 of \sites\all\modules\entity\includes\entity.wrapper.inc).
So I exposed the error further with guidance from: https://www.drupal.org/node/1928884
Then I refresh my page, to see the following output:
(\sites\all\modules\workflow\workflow.module on line 940)
EntityMetadataWrapperException: Unknown data property . in EntityStructureWrapper->getPropertyInfo() (line 351 of \sites\all\modules\entity\includes\entity.wrapper.inc).
Then I visit workflow.module on line 940 to see the following lines
// At this point, we may have redetermined and altered the field_name.
if (!$sid && $field_name !== NULL) {
$wrapper = entity_metadata_wrapper($entity_type, $entity);
// Get State ID for existing nodes (A new node has no sid - will be fetched later.)
// and normal node, on Node view page / Workflow history tab.
$sid = $wrapper->{$field_name}->value(); /* ====Line 940====*/
}
So I simply fix the error by adding an extra check:
if (!isset($field_name)) {
$sid = $wrapper->{$field_name}->value();
}
Now Error disappeared
Phew!
Comments
Comment #2
bakr CreditAttribution: bakr commentedComment #3
parasolx CreditAttribution: parasolx as a volunteer commentedThe error eliminate but state did not change. This is not the root of problem.
Comment #4
johnvHmm, but this is strange behaviour. See the complete code below.
The $field_name should either be space or contain a valid fieldname.
The error is in the providing function _workflow_info_fields(). Is one of you able to debug that function?
Please state:
- which version of Drupal are you using?
- are you using workflow_fiekld or workflow_node?
- is this with any node, or in some special situation?
- I presume the Workflow is set up correctly?
Comment #5
mitokens CreditAttribution: mitokens as a volunteer commentedI started getting (almost) the same exact error when accessing any node that uses a workflow after recently updating to Workflow 7.x-2.5 on Drupal 7.41.
The description in /admin/modules led me to believe I should be using workflow_node and not workflow_field (at least for now).
The only difference I have from the OP's issue is that my error is thrown in entity.wrapper.inc on line 335:
For the meantime I've employed the same hackaround as the OP, but I'd be interested in a proper fix.
Comment #6
johnv@mitokens, is it still happening with the dev version?
today, there was another change in the code from #4.
Comment #7
johnvCan someone also give a dpm (debug_backtrace ()) ?
( dpm needs devel module)
Comment #8
johnv@mitokens, i dont understand why you are doubting. What was the submodule you were using before update? From which version do you come?
Comment #9
mitokens CreditAttribution: mitokens as a volunteer commentedI updated to Workflow 7.x-2.x-dev. I am no longer able to reproduce the error.
Comment #10
mitokens CreditAttribution: mitokens as a volunteer commented(oops, ignore double-post.)
Comment #11
johnvClosing this very old issue.