Fatal error: Call to undefined method EntityValueWrapper::getIdentifier() in D:\drupal-7.0\sites\all\modules\userpoints\userpoints_rules.module on line 52
It seems this fatal error is due to a polymorphism issue: the object is not the type that supports that method (see http://www.drupalcontrib.org/api/drupal/contributions--entity--includes-...)
I'm not very familiar with PHP object approach, nor with the implementation of rules, but I checked the code and decided to change the line
$params['entity_id'] = $userpoints_transaction->entity->getIdentifier();
to this:
$params['entity_id'] = $userpoints_transaction->entity_id;
Sorry I'm not posting a formal patch, I don't know whether this fix actually makes sense... I just did it to get rid of the fatal error, I'm not using the rules integration, so I hope the maintainers can discuss/review/fix it properly. Thanks!
Comments
Comment #1
arithmetric commentedI can't reproduce this error. Can you describe the situation where you saw it?
Comment #2
mariano.barcia commentedI was processing an order, changing the status of the order from pending to complete, using a dev version of userpoints_ubercart for D7 I was working on. I couldn't see a relationship with this module, and I am not aware about the internals of rules module. I'm sorry I cannot provide further information right now, I may get back to my project next week, reverse the fix I did above, and check if it's still happening and how, and post again with more detailed information.
Comment #3
berdirSomething is wrong on your install I think, are you really sure that you are not using rules?
Comment #4
mariano.barcia commentedI have the module enabled, but I don't remember any rule about userpoints (I will be checking next week). If nobody else is having this issue, is good, you may demote its severity? You may check the pre-conditions of the object being used here or wait until I can provide more info, to discard any weird thing in my particular setup. The bad thing about it, even if it happens in a special case, is that it causes a fatal error :-/. Will keep you posted next week, thanks for the feedback.
Comment #5
berdirIs this still an issue?
Comment #6
mariano.barcia commentedI've postponed myproject and I don't know when I'm going to be able to provide more feedback, so I'm closing it for now, will re-open the issue if needed. Thanks!
Comment #7
basscleff94010 commentedI just experienced what I believe is the same error. Here is the message:
Fatal error: Call to undefined method EntityValueWrapper::get()
I am writing Rules in Commerce KS2.
The action is:
Fetch entity by property
Parameter: Entity type: Commerce Product, Property: Type, Value: [node:field-event-pieces:0...
Provides variables: Fetched entity (entity_fetched)
Comment #8
jantoine commented@basscleff94010,
You issues seems more related to one that I was having with Rules and Commerce which I posted and wrote a patch here: #2225215: Improper 'token type' definitions in hook_entity_info() implementations. You can apply that patch and clear caches and see if that resolves your issue. If it does, please comment in that issue!