Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned
Status: Active » Needs review
Issue tags: +Plugin system, +Annotation
FileSize
10.37 KB

Okay, here's the technical parts.
None of the keys were documented, so this just adds @todo.

amateescu’s picture

Completed the @todos and also fixed some doxygen while I was there. I hope I explained the grouping stuff well enough..

jibran’s picture

Issue tags: -Plugin system, -Annotation

Status: Needs review » Needs work
Issue tags: +Plugin system, +Annotation

The last submitted patch, entity-reference-selection-2016589-2.patch, failed testing.

dawehner’s picture

Well, it is your decision whether you want to port all the docs in this issue.

+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/SelectionPluginManager.phpundefined
@@ -28,8 +28,11 @@ class SelectionPluginManager extends PluginManagerBase {
+    $annotation_namespaces = array('Drupal\entity_reference\Annotation' => $namespaces['Drupal\entity_reference']);
+    $this->discovery = new AnnotatedClassDiscovery('entity_reference/selection', $namespaces, $annotation_namespaces, 'Drupal\entity_reference\Annotation\EntityReferenceSelection');
+    $this->discovery = new AlterDecorator($this->discovery, 'entity_reference_selection');
+    $this->discovery = new CacheDecorator($this->discovery, 'entity_reference_selection');

Just wondering whether the DefaultPluginManagerBase could be used here as well.

amateescu’s picture

Huh? There was nothing to port, that documentation didn't exist..

dawehner’s picture

I was talking about all the @inheritdoc instances.

amateescu’s picture

Well, it has to happen at some point, so I think a small patch like this is the perfect opportunity.

tim.plunkett’s picture

We should definitely use DefaultPluginManager here.

amateescu’s picture

Status: Needs work » Needs review
FileSize
3.39 KB
20.47 KB

Updated the patch to use DefaultPluginManager :)

Status: Needs review » Needs work

The last submitted patch, entity-reference-selection-2016589-10.patch, failed testing.

amateescu’s picture

Status: Needs work » Needs review
FileSize
2.83 KB
21.42 KB

So it seems that DefaultPluginManager's constructor doesn't really work for us, this should be better.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/SelectionPluginManager.phpundefined
@@ -9,28 +9,31 @@
+    $this->subdir = 'entity_reference/selection';
...
+    $this->discovery = new AnnotatedClassDiscovery($this->subdir, $namespaces, $annotation_namespaces, 'Drupal\entity_reference\Annotation\EntityReferenceSelection');

We don't want to have a derivative discovery here, as according to amateescu this caused issues here.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/SelectionPluginManager.phpundefined
@@ -9,28 +9,31 @@
   /**
-   * Constructs a SelectionPluginManager object.
-   *
-   * @param \Traversable $namespaces
-   *   An object that implements \Traversable which contains the root paths
-   *   keyed by the corresponding namespace to look for plugin implementations,
+   * {@inheritdoc}
    */
-  public function __construct(\Traversable $namespaces) {
-    $this->baseDiscovery = new AlterDecorator(new AnnotatedClassDiscovery('entity_reference/selection', $namespaces), 'entity_reference_selection');
-    $this->discovery = new CacheDecorator($this->baseDiscovery, 'entity_reference_selection');
+  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) {

We need to document why we are doing this.

amateescu’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
1.05 KB
21.57 KB

Sure thing ;)

amateescu’s picture

YesCT’s picture

Issue tags: +RTBC July 1

This issue was RTBC and passing tests on July 1, the beginning of API freeze.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1b0d6ac and pushed to 8.x. Thanks!

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