Problem/Motivation

#2054011: Implement built-in support for internal URLs added an improved link field type and corresponding widget that allows to reference internal and external paths.

Shortcut still has (pretty hacky) separate fields for that.

Also, this avoids the problem with computed field validation which we have with current hacky fields. Thus, this conversion is critical as it blocks #2403847: Shortcut content entity validation misses form validation logic.

Proposed resolution

Just like menu links will in #1842858: [PP-1] Convert menu links to the new Entity Field API, we should make shortcut entities use that field to simplify the UI code and fields it needs to use.

This also serves as a real-use test for converting menu links.

Remaining tasks

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Update the issue summary Instructions
Update the issue summary noting if allowed during the beta Instructions

User interface changes

API changes

CommentFileSizeAuthor
#136 2235457-135-followup.patch587 byteshussainweb
#127 2235457-127.patch30.84 KBdawehner
#127 interdiff.txt3.57 KBdawehner
#123 interdiff.txt1.66 KBWim Leers
#123 2235457-123.patch28.53 KBWim Leers
#122 interdiff.txt3.79 KBdawehner
#122 2235457-122.patch29.14 KBdawehner
#118 interdiff.txt1.01 KBdawehner
#118 2235457-118.patch31.27 KBdawehner
#117 2235457-117.patch31.3 KBhussainweb
#112 2235457-use-link-field-shortcut.patch31.35 KBRavindraSingh
#110 2235457-110.patch31.3 KBhussainweb
#110 interdiff-109-110.txt1.03 KBhussainweb
#109 2235457-109.patch31.29 KBhussainweb
#109 interdiff-107-109.txt2.58 KBhussainweb
#107 2235457-107.patch30.56 KBhussainweb
#107 interdiff-105-107.txt975 byteshussainweb
#105 interdiff.txt6.83 KBdawehner
#105 2235457-105.patch30.58 KBdawehner
#103 interdiff.txt15.22 KBdawehner
#103 2235457-103.patch31.47 KBdawehner
#89 2235457-89.patch35.9 KBdawehner
#86 2235457-86.patch36.05 KBdawehner
#83 interdiff.txt4.66 KBdawehner
#83 2235457-83.patch36.06 KBdawehner
#82 b8MBCeI.jpg96.57 KBjibran
#80 interdiff.txt5.62 KBdawehner
#79 2235457-79.patch34.66 KBdawehner
#76 interdiff.txt6.7 KBdawehner
#76 2235457-76.patch31.49 KBdawehner
#74 interdiff.txt5.27 KBdawehner
#74 2235457-74.patch27.96 KBdawehner
#72 2235457-72.patch24.6 KBdawehner
#69 2235457-69.patch25.96 KBdawehner
#66 interdiff.txt541 bytesbenjy
#66 2235457-64.patch25.97 KBbenjy
#64 2235457-63.patch26.49 KBbenjy
#62 2235457-62.patch26.32 KBbenjy
#58 2235457-58-interdiff.txt2.55 KBBerdir
#58 2235457-58.patch26.19 KBBerdir
#56 2235457-56-interdiff.txt4.47 KBBerdir
#56 2235457-56.patch25.97 KBBerdir
#53 2235457-53.patch28.95 KBAnonymous (not verified)
#50 interdiff.txt2.46 KBamateescu
#50 2235457-50.patch27.06 KBamateescu
#49 interdiff.txt5.77 KBamateescu
#49 2235457-49.patch25.98 KBamateescu
#46 interdiff.txt1.74 KBdawehner
#44 223547-44-reroll.patch25.34 KBlokapujya
#39 2235457-39.patch25.87 KBBerdir
#35 2235457-35.patch26.01 KBlokapujya
#26 interdiff.txt2.14 KBamateescu
#26 shortcut-link-2235457-26.patch26.56 KBamateescu
#24 interdiff.txt1.29 KBamateescu
#24 shortcut-link-2235457-24.patch25.14 KBamateescu
#22 interdiff.txt1.4 KBamateescu
#22 shortcut-link-2235457-22.patch23.85 KBamateescu
#20 drupal8-shortcut_link-2235457-20.patch24.19 KBJalandhar
#11 interdiff.txt1.51 KBamateescu
#11 shortcut-link-2235457-11.patch23.81 KBamateescu
#8 interdiff.txt1.6 KBamateescu
#8 shortcut-link-2235457-8.patch23.98 KBamateescu
#4 interdiff.txt1.54 KBamateescu
#4 shortcut-link-2235457-4-do-not-test.patch23.65 KBamateescu
#3 interdiff.txt16.33 KBamateescu
#3 shortcut-link-2235457-3.patch23.71 KBamateescu
#1 shortcut-link-2235457-1.patch16.95 KBBerdir
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
FileSize
16.95 KB

Yeah, the link field is as fun as it is broken :)

Known issues:
- Edit seems broken, the value is empty, the shortcut being edited is then also missing from the list
- Translatability, I guess we need to integrate the link field type with entity translation sync so that we can make the title translatable?
- Or should we not use the title of the link field?
- Currently set to type general, using internal only would simplify a lot and pretty sure we want that, but didn't want to think about that yet, just applying patterns that I found elsewhere..
- unserialize is ugly, but I have no idea how we can have passing tests right now, probably because we only use it as configurable field, which gets serialization handled properly?

Status: Needs review » Needs work

The last submitted patch, 1: shortcut-link-2235457-1.patch, failed testing.

amateescu’s picture

Status: Needs work » Needs review
FileSize
23.71 KB
16.33 KB

Yeah, the link field is as fun as it is broken :)

Most of the brokenness you found was actually because you forgot to put a 'link__url' column in the schema ;) Another part of it was coming from the change in #2054011-70: Implement built-in support for internal URLs, because massageFormValues() doesn't run on programatic updates. I had to revert that hunk and write a proper fix.

- Translatability, I guess we need to integrate the link field type with entity translation sync so that we can make the title translatable?
- Or should we not use the title of the link field?

I'd prefer to not use the title property of the link field, mostly because I see it as a main property of the entity.

- Currently set to type general, using internal only would simplify a lot and pretty sure we want that, but didn't want to think about that yet, just applying patterns that I found elsewhere..

shortcut.module goes to great lengths to ensure that the links are internal only (@see shortcut_valid_link()), so we definitely want the internal links option.

- unserialize is ugly, but I have no idea how we can have passing tests right now, probably because we only use it as configurable field, which gets serialization handled properly?

Yup :/

Here's an updated patch that will fix most of the errors. The patch above didn't apply, so the interdiffs for shortcut.install and ShortcutFormController are not reliable.

That said, we should have only two relevant failures left:
- shortcut supported an empty path as the url by converting it automatically to the front page. We need to either bake that into the link field or drop this feature.
- the link field doesn't support aliases atm, that's being fixed in #2231413: Link field does not accept a valid path alias

amateescu’s picture

Removed some debug leftovers and updated the label for this field.

Berdir’s picture

- __url schema => ups :)

- Are sure that preSave() doesn't mess with re-saving shortcuts without changes? That's why we moved the code there to massageFormValues(), but if that test still passes then that's fine with me.

- shortcut supported an empty path as the url by converting it automatically to the front page. We need to either bake that into the link field or drop this feature.

I think menu links always supported that by using as the path, I'd be fine with removing that special feature.

Do we have test for deleting shortcuts? That was broken when I was manually testing it and is related to #2232321: Limit validation errors on confirm form.

amateescu’s picture

I ran that test locally and it seems there's still a problem. I'll try to figure out a better solution because, unfortunately, moving that code to massageFormValues() is not the right fix..

Not sure if we have a test for deleting shortcuts but a manual test worked.

Status: Needs review » Needs work

The last submitted patch, 3: shortcut-link-2235457-3.patch, failed testing.

amateescu’s picture

Status: Needs work » Needs review
FileSize
23.98 KB
1.6 KB

Ok, so the logic of the fix was correct, just the implementation was wrong. We should be left only with #2231413: Link field does not accept a valid path alias now.

Status: Needs review » Needs work

The last submitted patch, 8: shortcut-link-2235457-8.patch, failed testing.

Berdir’s picture

Priority: Normal » Major
  1. +++ b/core/modules/link/lib/Drupal/link/Plugin/Field/FieldType/LinkItem.php
    @@ -62,6 +63,13 @@ public static function propertyDefinitions(FieldDefinitionInterface $field_defin
       /**
        * {@inheritdoc}
        */
    +  public static function mainPropertyName() {
    +    return 'url';
    +  }
    

    I'm not sure if this really makes sense here, is url really the main property and not just one of a set of equally important ones?

    What's interesting is I can't find a single use of this information right now in core, #2182239: Improve ContentEntityBase::id() for better DX will add a usage though

    Seems like you just use it in one place in the test, where you know it's a shortcut, so you could just hardcode url there if that's what you want?

  2. +++ b/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php
    @@ -95,38 +96,39 @@ public function setRouteName($route_name) {
    +  public function getUrl() {
    +    if ($this->link[0]->isExternal() && !$this->link->isEmpty()) {
    +      $url = Url::createFromPath($this->link->url);
    +      $url->setOptions($this->link->options);
    +    }
    +    else {
    +      $url = new Url($this->link->route_name, (array) $this->link->route_parameters, (array) $this->link->options);
         }
    +    return $url;
       }
    

    This can be simplified as well with only internal URL's...

  3. +++ b/core/modules/shortcut/lib/Drupal/shortcut/Form/SetCustomize.php
    @@ -51,7 +51,10 @@ public function form(array $form, array &$form_state) {
    -      $form['shortcuts']['links'][$id]['name']['#markup'] = l($shortcut->getTitle(), $shortcut->path->value);
    +      $form['shortcuts']['links'][$id]['name'] = array(
    +        '#type' => 'link',
    +        '#title' => $shortcut->getTitle(),
    +      ) + $shortcut->getUrl()->toRenderArray();
    
    +++ b/core/modules/shortcut/shortcut.module
    @@ -300,10 +300,10 @@ function shortcut_renderable_links($shortcut_set = NULL) {
    +    $links[$shortcut->id()] = array(
    +      'type' => 'link',
    +      'title' => $shortcut->getTitle(),
    +    ) + $shortcut->getUrl()->toArray();
       }
    

    We have to do this in two places now, and unfortunately it's not the same, one is just an array and the other is a render array, but still wondering if a method on Shortcut that returns the render array for it would be useful?

    I know you were considering to use view builders for menu links, but I think that is too much overhead, considering all the render cache logic that implies and that rendering an entity involves 2 hooks and two alter hooks at least. Or maybe an interface for a common set of methods that both shortcut and menu link will have so you can use the same code or maybe a helper method to do it?

  4. +++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
    @@ -42,7 +42,6 @@ public function testShortcutLinkAdd() {
         // Create some paths to test.
         $test_cases = array(
    -      array('path' => ''),
           array('path' => 'admin'),
    

    Do we want to keep the test but use ? Might need some special casing somewhere...

Either way, this looks pretty awesome now, just a bit worried that the field type change will imply yet another large-scale change for all our menu links... maybe we should allow to pass in the current structure for those, to avoid changing all default menu link definitions? Not worth for shortcuts...

Changing to major, as this also fixes a bunch of problems in the link field type that we want to have to make it easier to use elsewhere.. (redirect currently has the unserialize hacks in the entity class)

amateescu’s picture

Status: Needs work » Needs review
FileSize
23.81 KB
1.51 KB
  1. 'url' is the main property because all the other properties can be derived from it.
  2. Right, fixed.
  3. A method that returns the render array for a shortcut sounds useful indeed, but it has to be tied to its link field (e.g. getLinkRenderArray()) since the entity type is fieldable and we don't want to duplicate the viewbuilder's job.. It might be useful to have this method on the LinkItem field type class too, so maybe we need to introduce an interface for it, but in a separate issue?
  4. Do we want to keep the test but use ? Might need some special casing somewhere...

    I assume you meant <front> there, and yes, that's a good point. Fixed and it didn't need any special casing.

About menu links, I have no idea anymore how those will look like in D8, see #2178723: [meta-2] Finalize module-facing API of declaring menu links and the fourth child issue, so I prefer to not speculate on it at this point..

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Yes, I was just thinking out loud about default menu links, obviously not something we need to worry about here.

The other things were just ideas/questions, nothing blocking, so I think this is ready to go. I provided the initially patch but I think everything there has been reviewed and improved by @amateescu, so there's hardly any code left from the initial approach which was just a proof of concept :)

amateescu’s picture

Status: Reviewed & tested by the community » Postponed
Berdir’s picture

Oh, stupid me :)

Status: Postponed » Needs work

The last submitted patch, 11: shortcut-link-2235457-11.patch, failed testing.

amateescu’s picture

Status: Needs work » Postponed
YesCT’s picture

Issue summary: View changes
Berdir’s picture

11: shortcut-link-2235457-11.patch queued for re-testing.

Status: Postponed » Needs work

The last submitted patch, 11: shortcut-link-2235457-11.patch, failed testing.

Jalandhar’s picture

Status: Needs work » Needs review
FileSize
24.19 KB

Just re-rolled.

Status: Needs review » Needs work

The last submitted patch, 20: drupal8-shortcut_link-2235457-20.patch, failed testing.

amateescu’s picture

Status: Needs work » Needs review
FileSize
23.85 KB
1.4 KB

This should be better. Unfortunately, #2231413: Link field does not accept a valid path alias fixed the path alias problem at the wrong level...

Status: Needs review » Needs work

The last submitted patch, 22: shortcut-link-2235457-22.patch, failed testing.

amateescu’s picture

Status: Needs work » Needs review
FileSize
25.14 KB
1.29 KB

Meh!

Berdir’s picture

Looks good, two questions, a) Can/Should we remove the getSystemPath() call from where the other issue added it? and b) Some explicit test coverage would be nice, for example in the unit test?

amateescu’s picture

FileSize
26.56 KB
2.14 KB

a) It's already removed in the patch, see LinkWidget::massageFormValues() :)
b) Sure, somethis like this?

YesCT’s picture

Issue summary: View changes

updated issue summary to reflect this is nolonger blocked on #2231413: Link field does not accept a valid path alias

tried to identify remaining tasks. (please correct them, if I missed something)

Berdir’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

a) Ah, wasn't visible in the interdiff because.
b) Yes, looks fine :)

@YesCT: No remaining steps :)

chx’s picture

I think ultimike's #2242779: Link Module - Add an optionless link test test (maybe just as a new method to the existing test) should be merged into this because of the change in link module is untested.

amateescu’s picture

I looked at the patch from #2242779: Link Module - Add an optionless link test and the new test seems to be a verbatim copy of Drupal\link\Tests\LinkItemTest with some assertions commented out. What exactly is there to bring into this patch?

YesCT’s picture

In addition to not doing some assertions,
it also commented out, in the test, setting of some options.

I think in that issue, we were hoping it would fail, to show that something needed to be fixed.

amateescu’s picture

Ok, so we don't have anything to bring in here?

ultimike’s picture

The test that chx referred to in comment 29 isn't done yet - my thinking is that we need a test that saves a new link using $entity->save() (not Form API) and then tests the rendering of the link (not just testing entity_load()).

-mike

webchick’s picture

Status: Reviewed & tested by the community » Needs work

No longer applies.

lokapujya’s picture

FileSize
26.01 KB

Straight reroll. A deleted file from the patch was renamed in another patch.

lokapujya’s picture

Status: Needs work » Needs review
chx’s picture

Status: Needs review » Reviewed & tested by the community

This is fine; probably needs a followup for testing the link cleanup; but that shouldnt be holding up a major task.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 35: 2235457-35.patch, failed testing.

Berdir’s picture

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

Conflicted in ShortcutInterface.php, git apply -3 patch worked fine.

catch’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/lib/Drupal/Core/Url.php
@@ -122,6 +122,7 @@ public static function createFromPath($path) {
+        $path = \Drupal::service('path.alias_manager.cached')->getSystemPath($path);

In the vast majority of cases, this should already be using the system path. Should check $this->options['alias'] first. Otherwise this will add a lot of unnecessary queries.

If the caller doesn't know this, it should do the check, not Url itself.

Didn't review past that line.

lokapujya’s picture

<?php
$path = \Drupal::service('path.alias_manager.cached')->getSystemPath($path);
?>

Without that line, creating a shortcut to an alias fails testing.

Wim Leers’s picture

Status: Needs work » Needs review

39: 2235457-39.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 39: 2235457-39.patch, failed testing.

lokapujya’s picture

Status: Needs work » Needs review
FileSize
25.34 KB

getSystemPath() changed to getPathByAlias() in Core/Url.php.

Status: Needs review » Needs work

The last submitted patch, 44: 223547-44-reroll.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
1.74 KB

Fixed the failure + added some documentation.

  1. +++ b/core/lib/Drupal/Core/Url.php
    @@ -122,6 +122,7 @@ public static function createFromPath($path) {
    +        $path = \Drupal::service('path.alias_manager.cached')->getPathByAlias($path);
             $result = \Drupal::service('router')->match('/' . $path);
    

    It is kind of sad that we have to do that, but yeah path alias handling is done on the request level. Should we maybe document that here?

  2. +++ b/core/modules/shortcut/shortcut.install
    @@ -46,13 +43,27 @@ function shortcut_schema() {
    +      'link__url' => array(
    +        'description' => 'The URL of the link.',
    +        'type' => 'varchar',
    +        'length' => 2048,
    +        'not null' => FALSE,
    +      ),
    +      'link__route_name' => array(
    

    Is there really a need to store the URL, given that shortcuts will always link to internal paths.

  3. +++ b/core/modules/shortcut/src/Tests/ShortcutTestBase.php
    @@ -57,7 +57,10 @@ function setUp() {
    +          'url' => 'node/add',
    
    @@ -65,7 +68,10 @@ function setUp() {
    +          'url' => 'admin/content',
    

    As written before, it would be nice to not require both.

Wim Leers’s picture

#46: did you forget to upload the patch? :)

Wim Leers’s picture

Status: Needs review » Needs work

@dawehner, you forgot to upload the patch AFAICT. :)

amateescu’s picture

Status: Needs work » Postponed
FileSize
25.98 KB
5.77 KB

Refactored the code a bit so we don't need to store or use the 'url' property when we're dealing with internal paths only, but, sadly, this means we're now blocked on #2232321: Limit validation errors on confirm form.

@catch: We don't have any $this->options there because Url::createFromPath() is a factory method that receives only one argument, a path string.

I did see the performance problem when I added that line but we don't really have a good way to fix it, because making the caller always ensure it's sending a system path would make it quite easy to overlook (like we (I) did when adding internal path support to the link field).

One way of making it better (perf wise) would be to try and resolve the alias only if the initial match didn't yield any result. That would mean something like this, query wise:

- if a system path was passed in => the initial match finds it => 1 query
- if an invalid alias was passed in => initial match fails, resolving the alias fails => 2 queries
- if a valid alias was passed in => initial match fails, alias is resolved, second match finds it => 3 queries

That's quite a pessimistic scenario so any other ideas are welcome :)

amateescu’s picture

Status: Postponed » Needs review
FileSize
27.06 KB
2.46 KB

As suggested by @Berdir in #2232321: Limit validation errors on confirm form, let's just merge that patch in here.

Status: Needs review » Needs work

The last submitted patch, 50: 2235457-50.patch, failed testing.

anavarre’s picture

Anonymous’s picture

FileSize
28.95 KB

Attaching my attempt to re-roll this for PSR-4 following the instructions here: https://groups.drupal.org/node/424758

Result was "Fatal error: Unsupported operand types in /var/www/drupal/core/lib/Drupal/Core/Routing/UrlGenerator.php on line 242" when I ran a migration on a fresh install.

This is currently blocking #2277695: D6 > D8 link migration testing for me. I also tried to re-roll #2242779: Link Module - Add an optionless link test as an alternative, but this produced the same result.

lokapujya’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 53: 2235457-53.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
25.97 KB
4.47 KB

The patch accidentally re-added the manual schema and the path field, removing that makes it install again, did not check the patch beyound that yet.

Status: Needs review » Needs work

The last submitted patch, 56: 2235457-56.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
26.19 KB
2.55 KB

Status: Needs review » Needs work

The last submitted patch, 58: 2235457-58.patch, failed testing.

Berdir queued 58: 2235457-58.patch for re-testing.

The last submitted patch, 58: 2235457-58.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
FileSize
26.32 KB

Just a straight re-roll to try bring this issue back to life.

Status: Needs review » Needs work

The last submitted patch, 62: 2235457-62.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
FileSize
26.49 KB

I was going to take a look at this but after the amount of effort it took to re-roll i'm just posting the patch to see what else might have broken. I'd be happy if someone a little more qualified in this area could pick the issue up.

Status: Needs review » Needs work

The last submitted patch, 64: 2235457-63.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
FileSize
25.97 KB
541 bytes

Git!

Status: Needs review » Needs work

The last submitted patch, 66: 2235457-64.patch, failed testing.

dawehner’s picture

  1. +++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
    @@ -200,17 +200,30 @@ public function validateTitle(&$element, FormStateInterface $form_state, $form)
    -        $url = \Drupal::pathValidator()->getUrlIfValid($value['url']);
    -        if (!$url) {
    -          return $values;
    -        }
    +        try {
    +          $parsed_url = UrlHelper::parse($value['url']);
     
    -        $value += $url->toArray();
    +          // If internal links are supported, look up whether the given value is
    +          // a path alias and store the system path instead.
    +          if ($this->supportsInternalLinks() && !UrlHelper::isExternal($value['url'])) {
    +            $parsed_url['path'] = \Drupal::service('path.alias_manager')->getPathByAlias($parsed_url['path']);
    +          }
     
    -        // Reset the URL value to contain only the path.
    -        if (!$url->isExternal() && $this->supportsInternalLinks()) {
    -          $value['url'] = substr($url->toString(), strlen(\Drupal::request()->getBasePath() . '/'));
    +          $url = Url::createFromPath($parsed_url['path']);
    +          $url->setOption('query', $parsed_url['query']);
    +          $url->setOption('fragment', $parsed_url['fragment']);
    +          $url->setOption('attributes', $value['attributes']);
    +
    +          $value += $url->toArray();
    +        }
    +        catch (NotFoundHttpException $e) {
    +          // Nothing to do here, LinkTypeConstraintValidator emits errors.
             }
    +        catch (MatchingRouteNotFoundException $e) {
    +          // Nothing to do here, LinkTypeConstraintValidator emits errors.
    +        }
    +
    

    Sorry but these changes are certainly wrong. We explicit introduced the path validator to handle the usecases here. In case it doesn't it has to be adapted.

  2. +++ b/core/modules/shortcut/src/Entity/Shortcut.php
    @@ -107,37 +101,22 @@ public function setRouteName($route_name) {
    +  public function getUrl() {
    +    return new Url($this->link->route_name, (array) $this->link->route_parameters, (array) $this->link->options);
    

    Did we considered to add a getUrl method directly on the link item?

dawehner’s picture

Status: Needs work » Needs review
FileSize
25.96 KB

Rerolled, let's see how much fails.

Status: Needs review » Needs work

The last submitted patch, 69: 2235457-69.patch, failed testing.

mgifford’s picture

dawehner’s picture

Status: Needs work » Needs review
FileSize
24.6 KB

Let's reroll and get it installed.

Status: Needs review » Needs work

The last submitted patch, 72: 2235457-72.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
27.96 KB
5.27 KB

Let's see.

Status: Needs review » Needs work

The last submitted patch, 74: 2235457-74.patch, failed testing.

dawehner’s picture

FileSize
31.49 KB
6.7 KB

Some work ...

chx’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 76: 2235457-76.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
34.66 KB

A bit less ...

dawehner’s picture

FileSize
5.62 KB

With an interdiff ...

Status: Needs review » Needs work

The last submitted patch, 79: 2235457-79.patch, failed testing.

jibran’s picture

FileSize
96.57 KB

Number of times @dawehner clear the cache in tests to make em green is to damn high.

dawehner’s picture

Status: Needs work » Needs review
FileSize
36.06 KB
4.66 KB

The amount of wasted time without doing patch reviews is crazy.

Let's fix some of the failures.

Status: Needs review » Needs work

The last submitted patch, 83: 2235457-83.patch, failed testing.

yched’s picture

Mostly reviewed the link.module part for now.

  1. +++ b/core/lib/Drupal/Core/Url.php
    @@ -203,7 +203,7 @@ public static function fromRoute($route_name, $route_parameters = array(), $opti
    -    if (!parse_url($uri, PHP_URL_SCHEME)) {
    +    if ($uri != 'base://'  && !parse_url($uri, PHP_URL_SCHEME)) {
    

    Nothing I'm familiar with, but this could warrant a comment explaining why 'base://' deserves special consideration ?

  2. +++ b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
    @@ -176,6 +176,8 @@ protected function setupTestFields() {
    +    \Drupal::service('plugin.manager.field.widget')->clearCachedDefinitions();
    
    @@ -183,12 +185,14 @@ protected function setupTestFields() {
    +    \Drupal::service('plugin.manager.field.widget')->clearCachedDefinitions();
    ...
    +    \Drupal::service('plugin.manager.field.widget')->clearCachedDefinitions();
    

    It feels very weird that we need to clear the discovered widget plugins - and especially that often ?

    What causes the set of available widgets to change here ?

  3. +++ b/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php
    @@ -164,9 +165,36 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin
    +    $parsed_url = UrlHelper::parse(trim($this->url));
    +    $this->url = $parsed_url['path'];
    +    $this->options = ($this->options) ?: array();
    +
    +    // The link 'query' and 'fragment' parts need to be split and updated only
    +    // if they exist (e.g. when the 'url' property is new or updated).
    +    $options = array();
    +    if (!empty($parsed_url['query'])) {
    +      $options['query'] = $parsed_url['query'];
    +    }
    +    if (!empty($parsed_url['fragment'])) {
    +      $options['fragment'] = $parsed_url['fragment'];
    +    }
    +    $this->options = $options + $this->options;
    

    Hmm - such code is totally correct in the widget's massageFormValues(), but doesn't feel right here in LinkItem::preSave() :
    I don't think we want to support "$link_item->url can be either a raw url, or the 'path' part of a parsed url with ->options containing the parsed options", it should be one or the other ?
    (and thus it has to be the latter, since this is what the widget produces and what gets stored and loaded)

    I don't think allowing polymorphism on "what is found in an Item properties" is a good thing, since it means you de facto don't know what's in there and what you can do with the values at runtime.

    If needed, we can always add a $link_item->setPath($raw_url) as a helper for DX, that immediately expands into the single canonical shape for the url and options properties.

  4. +++ b/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php
    @@ -164,9 +165,36 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin
    +    if ($this->isExternal()) {
    +      return $this->url === NULL || $this->url === '';
    +    }
    +    else {
    +      return $this->route_name === NULL || $this->route_name === '';
    +    }
    

    '0' is moot for either url or root_name, right ?
    couldn't it be just
    return empty($this->route_name) && empty($this->url); ?

  5. +++ b/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php
    @@ -183,4 +211,19 @@ public function isExternal() {
    +  public function setValue($values, $notify = TRUE) {
    +    // Unserialize the values.
    +    // @todo The storage controller should take care of this.
    

    It should indeed - I thought we had support for 'serialized' columns in the field schemas (I think the image field type also has a serialized column (sorry, can't check atm), would be worth checking how it's done there ?)
    And if not, we should totally open a followup and link it there.

  6. +++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
    @@ -200,18 +205,40 @@ public function validateTitle(&$element, FormStateInterface $form_state, $form)
    +          // If internal links are supported, look up whether the given value is
    +          // a path alias and store the system path instead.
    +          if ($this->supportsInternalLinks() && !UrlHelper::isExternal($value['url'])) {
    +            $parsed_url['path'] = \Drupal::service('path.alias_manager')->getPathByAlias($parsed_url['path']);
    +          }
    

    Hm - that, on the other hand, might belong to LinkItem::preSave() ?

    Or is accepting aliases as input is only a feature of the widget, and is not supported on runtime LinkItem value ? Yeah, could make sense I guess.

    Anyway - again, it's a question of having clear and unambiguous semantics for the properties in a runtime LinkItem object.

dawehner’s picture

FileSize
36.05 KB

Thanks @yched for the review, though this is for now just a reroll.

mgifford’s picture

Status: Needs work » Needs review

I just want to engage the bot on this. Need to still address @yched points.

Status: Needs review » Needs work

The last submitted patch, 86: 2235457-86.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
35.9 KB

Let's do just the reroll.

Status: Needs review » Needs work

The last submitted patch, 89: 2235457-89.patch, failed testing.

YesCT’s picture

Issue summary: View changes
Issue tags: +Needs issue summary update

needs a beta evaluation (especially since this is a task)

andypost’s picture

Related issues: +#2315773: Create a menu link field type/widget/formatter
YesCT’s picture

pwolanin’s picture

We should possibly change course based on #2407505: [meta] Finalize the menu links (and other user-entered paths) system

At least, for shorcut we want to store the route info, for link field just the user-entered path

larowlan’s picture

If we just want route info, then do we want a PathElement based widget?

Takes path, converts to route/route name pair?

catch’s picture

Issue tags: +D8 upgrade path

There's been more discussion on #2407505: [meta] Finalize the menu links (and other user-entered paths) system.

Once the link field is applied to menu links, it makes sense to apply it to shortcuts too. This reverses the path vs. route storage decision but means we have the same storage model and expectations everywhere.

Tagging D8 upgrade path since this will require a schema change. Undecided on whether this is critical or not so leaving at major for now. If we don't treat it as critical, we need to discuss whether we'd go ahead with it after the upgrade path is supported with a hook_update_N() - mostly trying to avoid that though.

amateescu’s picture

Once the link field is applied to menu links, it makes sense to apply it to shortcuts too. This reverses the path vs. route storage decision but means we have the same storage model and expectations everywhere.

And sanity is restored! Nothing more I could wish for :)

larowlan’s picture

I think this now blocks #2403847: Shortcut content entity validation misses form validation logic which is critical - so does that in turn make this critical? or do we have enough criticals tracking this space.

fago’s picture

Priority: Major » Critical

I think this now blocks #2403847: Shortcut content entity validation misses form validation logic which is critical - so does that in turn make this critical? or do we have enough criticals tracking this space.

Enough yes, but afaik that's the way it works :/

fago’s picture

Issue summary: View changes

Updated summary.

dawehner’s picture

Status: Needs work » Postponed

Let's wait until #2411143: Change LinkItem schema to store URIs rather than URLs/paths/routes is in ... these potentially fixes a lot of the problems we had earlier here with various route related issues.

dawehner’s picture

Status: Postponed » Needs work

Unpostpone it.

Currently working on a "reroll", let's see how far we can get.

dawehner’s picture

Status: Needs work » Needs review
FileSize
31.47 KB
15.22 KB

Here is a first version.

One question I came up with: Where should the title of a shortcut be stored ... does that belong onto the link or not.

Status: Needs review » Needs work

The last submitted patch, 103: 2235457-103.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
30.58 KB
6.83 KB

Fixed the failures.

Status: Needs review » Needs work

The last submitted patch, 105: 2235457-105.patch, failed testing.

hussainweb’s picture

Status: Needs work » Needs review
FileSize
975 bytes
30.56 KB

Attempting to fix one of the failures, just so that I understand this better.

Status: Needs review » Needs work

The last submitted patch, 107: 2235457-107.patch, failed testing.

hussainweb’s picture

FileSize
2.58 KB
31.29 KB

This will not fix the last failure but I am just changing a test and I thought it best to do that independently. I will attach the patch with the fix shortly after this. I will set it to Needs Review with that patch.

hussainweb’s picture

Status: Needs work » Needs review
FileSize
1.03 KB
31.3 KB

This should fix the last two failures, but it is not done yet. The fix uses the Url::getInternalPath() method which is deprecated. The trouble is I can't find any substitute for this method except of inlining the function code (which might be wasteful in a test, especially if there is a ready substitute method).

We could also let this go in and let the code that removes the deprecated calls handle this. It is already used in over a dozen places.

Any suggestions?

hussainweb’s picture

Ah, all green.

Going up the comments, I see that the last review comments appeared in #85, but I am not sure if that is still valid. @yched, can you check again please? I know that at least one of the review comments were addressed in one of the patches since then.

RavindraSingh’s picture

Awesome,
but the Url::getInternalPath() is needs to be removed as deprecated function. So this can be achieved in similar way.

\$shortcut->getUrl()->getPathFromRoute($shortcut->getRouteName(), $shortcut->getRouteParameters()), '/'))\

Can be used as substitute.

RavindraSingh’s picture

Status: Needs review » Needs work

The last submitted patch, 112: 2235457-use-link-field-shortcut.patch, failed testing.

hussainweb’s picture

@RavindraSingh: Can you give an interdiff for your patch? Is that the only line you have changed?

hussainweb’s picture

@RavindraSingh: I did mention about this deprecated method in #110. I agree that it should be removed but I don't know if it is a good idea to block a critical on it. If we can fix it, great! But it doesn't seem that simple, not without adding many lines for this trivial use case.

Besides, there are lots and lots of places where this method is used. This could just be another instance to change when we deal with that issue. I am not convinced that the snippet you have given is actually the best way to substitute this. I have put in all the places where this method is used in #2413701-1: Url::getInternalPath() is marked deprecated but won't be removed for 8.0.x, so update the docs.

I would suggest that if we can quickly figure out a good substitute, we change it. Otherwise, we worry about the substitute in #2413701: Url::getInternalPath() is marked deprecated but won't be removed for 8.0.x, so update the docs and not block this critical. I still suggest the patch in #110. If everyone agrees, I will reupload it.

hussainweb’s picture

Status: Needs work » Needs review
FileSize
31.3 KB

I was trying out the snippet in #112 and realized that the method getPathFromRoute() is also deprecated. This means that if we can't use getInternalPath(), we can't use getPathFromRoute() either.

I am reuploading the patch from #110 to keep things clear until we find a better substitute. Else, I still suggest in dealing with that in #2413701: Url::getInternalPath() is marked deprecated but won't be removed for 8.0.x, so update the docs.

dawehner’s picture

FileSize
31.27 KB
1.01 KB

Let's keep it simple :)

hussainweb’s picture

Hahaha... Never realized those were public. :)

dawehner’s picture

Wim Leers’s picture

This patch is absolutely beautiful. If I were emotionally attached to Shortcut module, I'd cry!


I only found nitpicks, hence keeping at NR.

  1. +++ b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
    @@ -176,18 +176,22 @@ protected function setupTestFields() {
    +    \Drupal::service('plugin.manager.field.widget')->clearCachedDefinitions();
    +
         entity_create('field_storage_config', array(
           'field_name' => $this->fieldName,
           'type' => 'string',
           'entity_type' => $this->entityTypeId,
           'cardinality' => 1,
         ))->save();
    +    \Drupal::service('plugin.manager.field.widget')->clearCachedDefinitions();
         entity_create('field_config', array(
           'entity_type' => $this->entityTypeId,
           'field_name' => $this->fieldName,
           'bundle' => $this->bundle,
           'label' => 'Test translatable text-field',
         ))->save();
    +    \Drupal::service('plugin.manager.field.widget')->clearCachedDefinitions();
         entity_get_form_display($this->entityTypeId, $this->bundle, 'default')
    

    I think we can just keep the last plugin cache clearing call?

  2. +++ b/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php
    @@ -164,4 +164,28 @@ public function isExternal() {
    +    // @todo The storage controller should take care of this, see
    +    //   SqlCOntentEntityStorage::loadFieldItems.
    

    This still needs to happen in this issue?

  3. +++ b/core/modules/shortcut/src/Entity/Shortcut.php
    @@ -12,13 +12,14 @@
    + * @property \Drupal\link\LinkItemInterface link
    

    Is this a new annotation thing? Have not seen this before.

  4. +++ b/core/profiles/standard/standard.install
    @@ -22,18 +22,27 @@ function standard_install() {
    -  \Drupal::configFactory()->getEditable('system.site')->set('page.front', 'node')->save();
    +  \Drupal::configFactory()
    +    ->getEditable('system.site')
    +    ->set('page.front', 'node')
    +    ->save();
     
       // Allow visitor account creation with administrative approval.
       $user_settings = \Drupal::configFactory()->getEditable('user.settings');
    -  $user_settings->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
    +  $user_settings->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)
    +    ->save();
     
       // Enable default permissions for system roles.
       user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access comments'));
    -  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access comments', 'post comments', 'skip comment approval'));
    +  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array(
    +    'access comments',
    +    'post comments',
    +    'skip comment approval'
    +  ));
     
       // Enable all permissions for the administrator role.
    -  user_role_grant_permissions('administrator', array_keys(\Drupal::service('user.permissions')->getPermissions()));
    +  user_role_grant_permissions('administrator', array_keys(\Drupal::service('user.permissions')
    +    ->getPermissions()));
    

    These are unnecessary changes; they don't actually change anything, they just reformat existing code.

    Fine to keep though.

dawehner’s picture

FileSize
29.14 KB
3.79 KB

I think we can just keep the last plugin cache clearing call?

Not sure whether this was maybe just some sort of desperation.

This still needs to happen in this issue?

Opened an issue for that. A new critical issue in entity storage is a good start into the day: #2414835: SqlContentEntityStorage does not unserialize base field data

Is this a new annotation thing? Have not seen this before.

It is IMHO the best thing since sliced bread. It adds DX, because it explains, which properties exists, instead of of having nothing.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
28.53 KB
1.66 KB

Not sure whether this was maybe just some sort of desperation.

:D


Manually tested, still works fine. RTBC!


Two simple whitespace fixes in this reroll.

Wim Leers’s picture

dawehner had an excellent remark in IRC:

14:20:05 dawehner: WimLeers: do we want to store the title on the shortcut and not on the link field?
14:20:19 dawehner: WimLeers: so the patch stores the title still on the entity itself
14:20:26 dawehner: which is needed for entity label and what not
14:20:40 WimLeers: That is a great, great question.
14:20:44 WimLeers: I should've thought of that.
14:20:48 WimLeers: dawehner++
14:21:06 WimLeers: dawehner: is there any technical reason why it cannot live on the link field?
14:21:49 dawehner: WimLeers: well ... for the label() you can't
14:21:55 WimLeers: dawehner: that's what I thought
14:21:57 dawehner: WimLeers: it would also change the UI potentially
14:22:03 WimLeers: definitely

Plus amateescu's comment in #3:

I'd prefer to not use the title property of the link field, mostly because I see it as a main property of the entity.

IOW: anything that is a semantically essential field of an entity, should be an actual base field itself. Hence keeping this at RTBC.

amateescu’s picture

  1. +++ b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
    @@ -118,4 +118,12 @@ public function save(array $form, FormStateInterface $form_state) {}
    +    // Overwrite the default validation implementation as it is not necessary
    

    Override :)

  2. +++ b/core/modules/shortcut/src/Entity/Shortcut.php
    @@ -64,8 +65,8 @@ public function getTitle() {
       public function setTitle($link_title) {
    -    $this->set('title', $link_title);
    -   return $this;
    +    $this->link->set('title', $link_title);
    +    return $this;
    

    Based on the discussion above, this seems wrong.

  3. +++ b/core/modules/shortcut/src/Entity/Shortcut.php
    @@ -224,16 +174,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    -    $item_definition->setClass('\Drupal\shortcut\ShortcutPathItem');
    

    I don't see where we remove this class in the patch. Same for ShortcutPathValue.

  4. +++ b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
    @@ -37,42 +40,39 @@ public function testShortcutLinkAdd() {
    -      if (strpos($entity->route_name->value, 'node.') === 0) {
    -        $entity->save();
    -        $loaded = Shortcut::load($entity->id());
    -        $this->assertEqual($entity->route_name->value, $loaded->route_name->value);
    -        $this->assertEqual($entity->get('route_parameters')->first()->getValue(), $loaded->get('route_parameters')->first()->getValue());
    -      }
    +      $entity->save();
    +      $loaded = Shortcut::load($entity->id());
    +      $this->assertEqual($entity->link->options, $loaded->link->options);
    

    We should assert more fields/properties like before, not just ->link->options :)

  5. +++ b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
    @@ -81,15 +81,15 @@ public function testShortcutLinkAdd() {
    -    $this->assertRaw(t('The shortcut must correspond to a valid path on the site.'));
    +    $this->assertRaw(String::format('The URL %url is not valid.', ['%url' => 'admin']));
    

    Afaik, messages that might be translated in the UI are also asserted with t().

  6. +++ b/core/modules/shortcut/src/Tests/ShortcutTestBase.php
    @@ -62,18 +62,24 @@ protected function setUp() {
    +          'options' => [],
    ...
    +          'options' => [],
    

    Shouldn't the default be an empty array? Why do we need to set it specifically?

  7. +++ b/core/profiles/standard/standard.install
    @@ -58,7 +58,7 @@ function standard_install() {
    +    'link' => array('node/add'),
    
    @@ -66,7 +66,7 @@ function standard_install() {
    +    'link' => array('admin/content'),
    

    Here we rely on mainPropertyName(), how about passing an array with the 'uri' key?

catch’s picture

Status: Reviewed & tested by the community » Needs work
dawehner’s picture

Status: Needs work » Needs review
FileSize
3.57 KB
30.84 KB

Good points!

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Note for other reviewers: #125.3 is not in the interdiff but it is included in the patch.

I worked a lot on this patch many months ago but I think it received enough updates and reviews from other people so setting back to RTBC :)

dawehner’s picture

Note for other reviewers: #125.3 is not in the interdiff but it is included in the patch.

Damn, I suck at git.

The last submitted patch, 109: 2235457-109.patch, failed testing.

Gábor Hojtsy’s picture

+++ b/core/modules/shortcut/src/Entity/Shortcut.php
@@ -205,13 +146,22 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
+    $fields['link'] = BaseFieldDefinition::create('link')
+      ->setLabel(t('Path'))
+      ->setDescription(t('The location this shortcut points to.'))
+      ->setRequired(TRUE)
+      ->setTranslatable(FALSE)

It was discussed above that even though the link field has a title (and a description following #2413029: Change LinkItem schema to also store a description), that is not being used because the entity needs a label. Why is the field kept translatable then? Do we expect to support links different per language in a shortcut? The similar menu link patch at #2406749: Use a link field for custom menu link does not make the link field translatable.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Less shortcut specialness - yay. This issue addresses a critical bug and is allowed per https://www.drupal.org/core/beta-changes. Committed f2fa574 and pushed to 8.0.x. Thanks!

  • alexpott committed f2fa574 on 8.0.x
    Issue #2235457 by dawehner, amateescu, hussainweb, Berdir, benjy, Wim...
Gábor Hojtsy’s picture

I misread that. setTranslatable(FALSE) is fine. That is the default, so we don't do setting it to FALSE anywhere other than 2 tests, so it would be nice to remove.

Wim Leers’s picture

Why is the field kept translatable then? Do we expect to support links different per language in a shortcut?

But the code already says setTranslatable(FALSE) — so the link field isn't translatable.

Discussed with Gábor in chat. setTranslatable(FALSE) is the default. Hence it's opt-in, and he misread it precisely because it's opt-in: presence of a setTranslatable() call at all typically implies it's translatable.

So, rectifying that detail in #2415129: Small clean-up for Shortcut entity's usage of link field.

hussainweb’s picture

Status: Fixed » Needs review
FileSize
587 bytes

I am uploading a patch to address #134 and setting that to Needs review. I know it is not critical and is already default, so wouldn't break anything, but it would be nice to keep this consistent.

Wim Leers’s picture

Status: Needs review » Fixed

#136: that's very helpful — thank you! — but we don't post follow-up patches after the patch for an issue has been committed. I've already filed a follow-up issue with the exact same patch, as you can see in #135 :)

hussainweb’s picture

@Wim Leers: We must have submitted at the same time. I saw your comment once the page reloaded. :)

yched’s picture

Late to the party, but I could indeed cry at the amount of weirdness that was removed here :-)

I too was wondering why the Shortcut entity preserves a separate 'title' field and keeps the 'title' property in its LinkItem unused, but I see this has been discussed at length above. Just, since it seems a couple people raised the topic, maybe it would be worth writing down the reason in Shortcut::baseFieldDefinitions() ?
(also - Shortcut::label() could return $this->link->title, couldn't it ?)

Other than that :

+++ b/core/modules/shortcut/src/Entity/Shortcut.php
@@ -12,13 +12,14 @@
 /**
  * Defines the shortcut entity class.
  *
+ * @property \Drupal\link\LinkItemInterface link
+ *
  * @ContentEntityType(

I thought that was unintentional, then I saw #121 / #122 :

- Is this a new annotation thing? Have not seen this before.
- It is IMHO the best thing since sliced bread. It adds DX, because it explains, which properties exists, instead of of having nothing.

Hmm, why not on principle, but that indication is incorrect, $shortcut->link is a FieldItemList, not a LinkItem ?

Berdir’s picture

(also - Shortcut::label() could return $this->link->title, couldn't it ?)

It could, but we commonly don't override that method and it would e.g. require a shortcut entity query selection plugin, if you'd want to support autocomplete. Users are already annoying enough in regards to that.

Agreed that it is technically the wrong class, there is afaik a separate issue that is trying to add this in a lot of places, and it worked around this by adding both the list and the item class *and* itemClass[] IIRC, so that it reflects magic __get/__set and array access.

amateescu’s picture

@yched, the discussion here was not really at length, see #2406749-17: Use a link field for custom menu link and below if you want to join the fun.

amateescu’s picture

it would e.g. require a shortcut entity query selection plugin, if you'd want to support autocomplete.

@Berdir, or we could do the second to last paragraph from #2406749-25: Use a link field for custom menu link. Not saying that we have to, I'm just trying to lay down all the possible options.

Berdir’s picture

And see #2336101: [policy, then patch] Add @property statements to FieldType classes for better IDE completion for the @property issue, which has been delayed forever by moving it to the Technical Working Group.

amateescu’s picture

We kind of broke every D8 install in a way that I'm not sure is even fixable manually :( #2415633: Fatal error: Class 'Drupal\link\LinkItemInterface' not found in core/modules/shortcut/src/Entity/Shortcut.php on line 156

pwolanin’s picture

I'd also like to see us use the associated Link field title column as long as translation will work - otherwise the link field vs shortvut and menu ink will potentially remain somewhat divergent.

Gábor Hojtsy’s picture

@pwolanin: I believe that would need #2403455: FieldTranslationSynchronizer does not sync columns that are absent from any column_group in the annotation (which IMHO is not a problem) to be able to translate title/description but not the rest.

fago’s picture

Interesting to see LinkTypeConstraint being a single class, as suggested by #2226821: Combine Drupal Constraint and ConstraintValidation classes into one a while ago. However, looking at it I'm not sure it's something we should practice, let's discuss at #2226821: Combine Drupal Constraint and ConstraintValidation classes into one

YesCT’s picture

Status: Fixed » Closed (fixed)

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