I was trying to debug an issue like #1842842: Best way to get/update the lastet dev release? with the error message
EntityMetadataWrapperException: Unknown data property field_target_nodes. in EntityStructureWrapper->getPropertyInfo()
After a while I realized that the message types "commons_notify_comment_created", "commons_notify_node_created" and "commons_notify_node_created_no_groups" didn't contain any fields anymore except "metatags". (see attachment)
Fields like "field_target_nodes", "field_target_comments", "field_message_rendered_subject", "field_message_rendered_body" are missing.
However, the status is show as "Default" for all of them. Changing and then reverting them didn't restore the fields, so I had to recreate them manually.
I tried to update from beta2 to the latest dev and recreated the message type, but also without any luck.
The issue didn't appear on a fresh install. On the affected install the message types have not been modified before the issue appeared. I'm not sure what was causing this problem or if the fields will get deleted again even after creating them manually.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | admin_structure_features_commons_notify_diff_message_type.png | 106.17 KB | thomas.feichter |
| commons_notify_comment_created-fields.png | 21.05 KB | thomas.feichter | |
| messages.png | 36 KB | thomas.feichter |
Comments
Comment #1
thomas.feichter commentedSorry, copied the wrong issue id. Here the correct one:
#1913702: Target field_target_nodes missing from 'node created' message
Comment #2
jpontani commentedThere must have been an issue with your existing install prior to updating. Currently, there is no upgrade path from any beta to dev releases, as such, any field definitions that have been added to dev aren't guaranteed to be installed properly. Features do not automatically update upon upgrading, you will have to manually revert features to their code definitions.
Comment #3
thomas.feichter commentedThat is correct, the issue appeared in beta2. As reverting the message types in beta2 didn't help, I tried to update to the latest dev version.
Yesterday I just tried to restore the message types but didn't think about restoring commons_notify feature (it was too late at night probably). Did that now (in beta2) and it restored the message fields.
Still not sure though what caused the feature to be overwritten in the first place, as the message types have not been modified before the issue appeared.
I'll try to reproduce the problem.
I changed the issue version to beta2, that's more accurate and priority to normal as there is an easy workaround (if the feature has not been customized).
Comment #4
ezra-g commentedOne change between beta2 and the latest dev related to field exports is that we updated the patch to Features module for #1064472: separate fields from field instances.
@thomas.feichter - It would be very helpful if you could test an upgrade between beta2 and the latest dev, reverting all feature modules after updating the codebase. You can use the drush features-revert-all command to help make this task faster.
Comment #5
ezra-g commentedComment #6
thomas.feichter commentedI did now the following workflow:
- Updated "broken" beta2 to dev version from yesterday
- Tested commenting, which resulted in a PHP error
- Reverted all features with drush:
- Tested commenting, which still resulted in a PHP error
- Checked features and message types and realized that all features except commons_notify have been reverted.
- Tried to revert the feature commons_notify manually, but also that didn't work out even though i get the notification: "Reverted all message_type components for commons_notify."
Reverting commons_notify in beta2 was working without problems.
Comment #7
jpontani commentedWhat does the Override tab say for Commons Notify? What is overridden?
Comment #8
ezra-g commentedCan you specify the PHP error?
Comment #9
ezra-g commentedComment #10
thomas.feichter commented@jpontani
It is still overridden (see attachment)
@ezra-g
If I create a comment or a node I get the same error as mentioned above:
Because field_target_nodes is being accessed in the functions commons_notify_node_insert and commons_notify_comment_insert without checking if it actually exists.
A small workaround to make this issue less critical could be to check if the field exists and if not simply skip it and eventually log it to ease debugging in case the fields are missing. That would't cause the commenting and node creation functionality to break if there is any issue with the message fields.
Comment #11
thomas.feichter commentedComment #12
ezra-g commentedit doesn't appear that this is reproducible on a fresh install - Marking as "cannot reproduce."
Please re-open if you can provide steps to reproduce the problem and we'll debug it.