Comments

Uncle_Code_Monkey’s picture

Status: Closed (duplicate) » Active
joachim’s picture

Ok will do!

mikran’s picture

Uncle_Code_Monkey’s picture

Status: Active » Needs review
StatusFileSize
new3.66 KB

Re-opening this issue since it really isn't a duplicate of #1856210. Copying my patch file here and renaming it so that it is applied in the correct place. Several comments in #1856210 apply here and are worth a read.

steveoliver’s picture

steveoliver’s picture

mikran’s picture

Status: Needs review » Needs work

Some of the changes might not be needed.

-          $options["$entity_type:$entity_id"] = "$entity_bundle: " . entity_label($entity_type, $entity);
+          $bundle_label = _relation_get_bundle_label($entity_type, $entity_bundle);
+          $options["$entity_type:$entity_bundle:$entity_id"] = $bundle_label . ': ' . entity_label($entity_type, $entity);

It looks like $entity_bundle is not needed in option keys at all. As of now it's used in relation_entity_collector_validate:

+      // Get entity info from key ('{entity_type}:{entity_bundle}:{entity_id}').
+      $entity_info = explode(':', $entity_key);

Outside of that validate function there is no use for it. Yes, previously it was there as well but bundle information is not needed when endpoints are saved.

In addition to that I think the following would be more readable here.

list($entity_type, $entity_id) = explode(':', $entity_key);
mikran’s picture

Priority: Major » Normal
Status: Needs work » Needs review
StatusFileSize
new4.81 KB

Updated patch, changes from comment 7 applied.

mikran’s picture

mikran’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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