RESTful-Drupal / restful

RESTful best practices for Drupal
https://drupal.org/project/restful
419 stars 173 forks source link

Call to undefined method EntityValueWrapper::entityKey() after updating #984

Closed rhclayto closed 7 years ago

rhclayto commented 7 years ago

After updating RESTful 7x.2x to the latest version from GitHub, I began getting unrecoverable errors when running update.php or using drush cc all & drush rr. I'm on Drupal 7 latest, PHP7, FreeBSD 10.3. I'm also using the token auth submodule & the User Registration module I created: https://github.com/rhclayto/restful_user_registration .

WD php: Error: Call to undefined method EntityValueWrapper::entityKey() in              [error]
Drupal\restful\Plugin\resource\Field\ResourceFieldEntity->propertyOnEntity() (line 1168
of
/var/www/hosting/tellingua/com/htdocs/backend/sites/all/modules/contrib/restful/src/Plugin/resource/Field/ResourceFieldEntity.php).

Error: Call to undefined method EntityValueWrapper::entityKey() in Drupal\restful\Plugin\resource\Field\ResourceFieldEntity->propertyOnEntity() (line 1168 of /var/www/hosting/tellingua/com/htdocs/backend/sites/all/modules/contrib/restful/src/Plugin/resource/Field/ResourceFieldEntity.php).

Drush command terminated abnormally due to an unrecoverable error.

Trying to roll back to the previous version of RESTful I had installed, but the errors now remain & the site is unusable.

I tried deleting the restful_example module, & all references to it in the registry in the database, still no luck.

Any ideas what is going on? I saw this issue but it's closed & I never had restful_example module installed or enabled: https://github.com/RESTful-Drupal/restful/issues/822 . Nothing changed between the working RESTful install & the broken one except replacing the module directory.

rhclayto commented 7 years ago

Okay, I found the problem. I had a resource defined that referred to a custom entity type that I had removed without removing the RESTful resource definition. For some reason this didn't cause errors until I upgraded RESTful. Removing the resource definition solved the problem.

I'll close this.