Comments

klausi’s picture

Status: Needs review » Needs work
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/Derivative/EntityDerivative.php
@@ -22,6 +24,36 @@ class EntityDerivative implements DerivativeInterface {
+   *   The base plugin ID.
+   * @param \Drupal\Core\Entity\EntityStorageControllerInterface $view_storage_controller
+   *   The entity storage controller to load views.

To load views? ;-)

Otherwise looks good to me. Note that this will collide with #2011122: Replace drupal_container() with injected services in the rest module, so whatever gets commited first somebody will need to re-roll.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new1.12 KB
new5.66 KB

Hehe, oops :)

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Cool, assuming the testbot is happy, too.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/Derivative/EntityDerivative.phpundefined
@@ -7,12 +7,14 @@
@@ -22,6 +24,36 @@ class EntityDerivative implements DerivativeInterface {

@@ -22,6 +24,36 @@ class EntityDerivative implements DerivativeInterface {
+    $this->basePluginId = $base_plugin_id;

Missing @var docblock and protection afaics.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new4.23 KB

Yep, totally right!

I have rolled back the conversion to default plugin manager too, as I think something got in to change this to use ReflectionFactory instead?

Status: Needs review » Needs work

The last submitted patch, 2047593-5.patch, failed testing.

klausi’s picture

I think we should ignore $base_plugin_id as we don't use it all in this class and it just bloats the code.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new3.58 KB

ok, I don;t mind either way :) New patch, no base_plugin_id.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Hard-coding the EntityManager class all over the place worries me, we should use an EntityManagerInterface for that. Otherwise the plugin.manager.entity service cannot really be swapped by contributed modules, which is bad. But that is a different issue (which might not even exist yet?), the other changes look good.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2047593-8.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new1.3 KB
new3.57 KB

Meh, sorry.

jibran’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs a reroll

git ac https://drupal.org/files/2047593-11.patch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3658  100  3658    0     0   5725      0 --:--:-- --:--:-- --:--:--  7243
error: patch failed: core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php:7
error: core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php: patch does not apply
damiankloip’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new2.29 KB

Now that ResourcePluginManager is using DefaultPluginManager, we can just remove that part of the patch. We only need to touch the EntityDerivative class.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Still looks good, back to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 6fa0fe8 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.