Problem/Motivation

STR:
* Create a menu link as entity:user/1
* Edit, it shows as "TitleOfFirstNode (1)"
* Save, the link is changed to a node.

Proposed resolution

Do not switch to autocomplete mode unless it is a node

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

Status: Active » Needs review
Issue tags: +Needs tests
FileSize
1.04 KB
dawehner’s picture

This looks like a fine workaround until we have the other issue solved.

Status: Needs review » Needs work

The last submitted patch, 2: link-non-node-link-2804391-2.patch, failed testing.

amateescu’s picture

Status: Needs work » Needs review
FileSize
2.42 KB
2.39 KB

Since displaying the autocomplete label for non-node entity types is a bug, we just have to update the test and use a node for that assertion :)

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wolffereast’s picture

Issue tags: +Baltimore2017

Beginning Triage

wolffereast’s picture

Version: 8.3.x-dev » 8.4.x-dev
Status: Needs review » Needs work
Issue tags: +Needs reroll, +Triaged for D8 major current state

Confirmed that the bug is still present.
The patch no longer applies. Specifically the file in which the test that was modified lived has been moved and refactored, so that needs to be reworked. The line number in LinkWidget has changed.
The fix still works when applied by hand

arunkumark’s picture

Status: Needs work » Needs review
FileSize
1.08 KB

I have re-rolled patch for the Drupal 8.4.x version.

Status: Needs review » Needs work

The last submitted patch, 9: resaving-menu-links-2804391-9.patch, failed testing.

gaurav.kapoor’s picture

Status: Needs work » Needs review
FileSize
2.47 KB

Status: Needs review » Needs work

The last submitted patch, 11: resaving-menu-links-2804391-11.patch, failed testing.

jofitz’s picture

FileSize
1.27 KB

@gaurav.kapoor please can you remember to include an interdiff where possible.

gaurav.kapoor’s picture

@Jo , i just re rolled #5. I don't think an interdiff was needed. Sorry for the confusion.

jofitz’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.07 KB
1014 bytes

Remove line saving non-existent variable.
Replace deprecated variable.
(remove Needs Reroll tag)

jofitz’s picture

FileSize
1014 bytes
2.76 KB

My previous patch went wrong somehow, let's try again.

The last submitted patch, 15: 2804391-14.patch, failed testing.

Mac_Weber’s picture

+++ b/core/modules/link/tests/src/Functional/LinkFieldTest.php
@@ -95,11 +96,7 @@ public function testURLValidation() {
-    // Create an entity with restricted view access.
-    $entity_test_no_label_access = EntityTest::create([
-      'name' => 'forbid_access',
-    ]);
-    $entity_test_no_label_access->save();
+    $restricted_node = $this->drupalCreateNode(['status' => NodeInterface::NOT_PUBLISHED]);

Here we are replacing a test with a custom entity with restricted access to a node with restricted access?

I think we need both tests. In addition, test an entity with unrestricted access, too.

cilefen’s picture

I am adding credit to wolffereast for the triage work done. Just FYI, we like to see documented triage steps (even if brief). Here are some made-up examples of documented triage steps:

  • I tested the steps to reproduce and they did (or did not) work (so I am tagging it "Needs issue summary update").
  • I searched for duplicate issues but could not find any.
  • I checked the issue summary and it is accurate and up-to-date.
  • Etc...

Thank you!

Berdir’s picture

Status: Needs review » Needs work

Re #18. See comment #5, the old test was a wrong behavior, so we do not need that to be tested.

We do however still need actual test coverage for the bug being fixed here.

cilefen’s picture

Priority: Major » Critical
Issue tags: -Triaged for D8 major current state +Triaged D8 critical

Thank you, everyone, for working on this.

@xjm, @alexpott, @effulgentsia, @lauriii, @catch and I discussed this issue at a recent meeting and decided this is critical because it affects data integrity when people edit links.

(edited)

Berdir’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
2.64 KB
5.14 KB

Finally got around to write a test for this.

The last submitted patch, 22: 2804391-22-test-only.patch, failed testing.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

I believe this is a thoughtfull test including good description comments.

+++ b/core/modules/link/tests/src/Functional/LinkFieldTest.php
@@ -652,6 +649,67 @@ public function testLinkTypeOnLinkWidget() {
+    $entity_test_storage->resetCache();
+    $entity_test = $entity_test_storage->load($entity_test->id());

Note: This doesn't block a commit but you should be able to use loadUnchanged here instead, but seriously, these details matter less on tests, IMHO.

alexpott’s picture

Version: 8.4.x-dev » 8.3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed a12adc7 and pushed to 8.4.x. Thanks!

This needs a re-roll on 8.3.x.

  • alexpott committed a12adc7 on 8.4.x
    Issue #2804391 by Berdir, Jo Fitzgerald, amateescu, gaurav.kapoor,...
jofitz’s picture

Re-rolled the patch from #22 for 8.3.x.

jibran’s picture

jibran’s picture

Status: Needs review » Reviewed & tested by the community

Green!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed e5ee7c9 and pushed to 8.3.x. Thanks!

Thanks for the quick reroll.

  • alexpott committed e5ee7c9 on 8.3.x
    Issue #2804391 by Jo Fitzgerald, Berdir, amateescu, gaurav.kapoor,...

Status: Fixed » Closed (fixed)

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

rajeevku’s picture

Shouldn't we remove @todo now as patch has been submitted in https://www.drupal.org/node/2423093.