When installed this module in the latest drupal 8 dev branch, it raised fatal error when I access the page admin/config/services/rest .
The error can be fixed by replacing drupal_container with Drupal::service which is fixed in the drupal core ticket #2001206: Replace drupal_container() with Drupal::service()
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | undefined_drupal_container-2169253-1.patch | 2.44 KB | pflame |
| undefined_drupal_container.patch | 834 bytes | pflame |
Comments
Comment #1
pflame commentedI found that drupal_container function is used in multiple files when I add, edit resources. The comment has full patch which will replace the drupal_container with \Drupal::service()
Comment #2
klausido not use \Drupal in classes. All dependencies of a class should be passed into the constructor, if possible. ContainerInjectionInterface with public static function create(ContainerInterface $container) helps with that. Example: https://drupal.org/node/2060189
Comment #3
juampynr commentedCommitted @pflame's patch http://drupalcode.org/project/restui.git/commit/1a58a4d Thanks!
Also improved Dependency Injection in the module's classes as suggested by @klausi http://drupalcode.org/project/restui.git/commit/b5b176c.