Problem/Motivation

RelationLinkManager::getRelationInternalIds references RelationLinkManagerInterface::getRelationInternalIds but there is no such method

Proposed resolution

Add it

Remaining tasks

Review

User interface changes

None

API changes

Interface method that should have been there, is there.

Patch coming

Comments

larowlan’s picture

Status: Active » Needs review
StatusFileSize
new3.28 KB

winner winner chicken dinner

Status: Needs review » Needs work

The last submitted patch, 1: rest-interfi-2355977.1.patch, failed testing.

larowlan’s picture

Status: Needs work » Needs review
StatusFileSize
new626 bytes
new3.89 KB
dawehner’s picture

+++ b/core/modules/rest/src/LinkManager/RelationLinkManagerInterface.php
@@ -23,4 +23,31 @@
    */
   public function getRelationUri($entity_type, $bundle, $field_name);
...
+   * @return array
+   *   Array with keys 'field_name', 'entity_type' and 'bundle'.
+   */
+  public function getRelationInternalIds($relation_uri);

Should we order the documentation in the way it makes sense? entity_type, bundle and then field_name.

larowlan’s picture

Issue tags: +Novice

sure

dashaforbes’s picture

this is my first drupal core patch.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Perfect, thank you!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +needs test
+++ b/core/modules/rest/src/LinkManager/LinkManager.php
@@ -62,4 +62,12 @@ public function getRelationUri($entity_type, $bundle, $field_name) {
+  /**
+   * {@inheritdoc}
+   */
+  public function getRelations() {
+    return $this->relationLinkManager->getRelations();
+  }

This function must be untested and unused...

larowlan’s picture

Status: Needs work » Needs review
StatusFileSize
new3.28 KB
new1.95 MB

RelationLinkManager::getRelations and TypeLinkManager::getTypes are both public but the only uses in core are by themself - moved them to protected and removed the extra function/from the interface

larowlan’s picture

Issue tags: -Novice, -needs test
StatusFileSize
new3.44 KB

whoops, didn't merge 8.0.x

jhedstrom’s picture

Status: Needs review » Reviewed & tested by the community

I think the patch in #10 addresses the concerns raised above.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per #2350615: [policy, no patch] What changes can be accepted during the Drupal 8 beta phase?. Committed 7c0295d and pushed to 8.0.x. Thanks!

  • alexpott committed 7c0295d on 8.0.x
    Issue #2355977 by larowlan, dashaforbes: Fixed Code references...

Status: Fixed » Closed (fixed)

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