Problem/Motivation

After path aliases are converted to entities, we should be able to convert their custom admin overview to an entity list builder.

Proposed resolution

Do it.

Remaining tasks

See above.

User interface changes

Nope.

API changes

Nope.

Data model changes

Nope.

CommentFileSizeAuthor
#28 interdiff-28.txt812 bytesamateescu
#28 3011807-28.patch17.68 KBamateescu
#25 interdiff-25.txt4.64 KBamateescu
#25 3011807-25.patch16.88 KBamateescu
#22 Path_aliases___Drupal_8_x.jpg165.96 KBplach
#17 interdiff-17.txt1.1 KBamateescu
#17 3011807-17.patch15.46 KBamateescu
#15 interdiff-15.txt2.13 KBamateescu
#15 3011807-15-combined.patch71.75 KBamateescu
#15 3011807-15.patch15.43 KBamateescu
#14 3011807-14-combined.patch65.88 KBamateescu
#14 3011807-14.patch13.3 KBamateescu
#11 3011807-11-combined.patch162.95 KBamateescu
#11 3011807-11-for-review.patch13.3 KBamateescu
#10 3011807-10-combined.patch169.22 KBamateescu
#9 3011807-9-combined.patch160.5 KBamateescu
#9 3011807-9-for-review.patch13.29 KBamateescu
#7 3011807-7-combined.patch141.26 KBamateescu
#6 3011807-6-combined.patch141.52 KBamateescu
#5 3011807-5-combined.patch141.12 KBamateescu
#5 3011807-5-for-review.patch13.18 KBamateescu
#4 3011807-4-combined.patch140.53 KBamateescu
#3 3011807-3-combined.patch140.6 KBamateescu
#3 3011807-3-for-review.patch13.71 KBamateescu
#2 3011807-for-review.patch13.73 KBamateescu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amateescu created an issue. See original summary.

amateescu’s picture

Status: Active » Postponed
FileSize
13.73 KB

This patch applies on top of #3007832-5: Convert custom path alias forms to entity forms, not posting a combined patch yet because there's some work to be done in the other issues.

amateescu’s picture

amateescu’s picture

The dependent patch has been fixed, there's no change to the "for review" one here so just posting a combined one to get a green light from the testbot :)

amateescu’s picture

amateescu’s picture

Rerolled the combined patch again, the review one doesn't need an update.

amateescu’s picture

Rerolled the combined patch again.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

amateescu’s picture

Title: Convert the path alias admin overview to a list builder » [PP-2] Convert the path alias admin overview to a list builder
FileSize
13.29 KB
160.5 KB
amateescu’s picture

Rerolled the combined patch.

amateescu’s picture

Yet another reroll :)

jibran’s picture

Title: [PP-2] Convert the path alias admin overview to a list builder » [PP-1] Convert the path alias admin overview to a list builder
Chris Matthews’s picture

Status: Postponed » Needs review
amateescu’s picture

Status: Needs review » Postponed
Issue tags: +Needs change record updates
FileSize
13.3 KB
65.88 KB
amateescu’s picture

Based on #3007832-30: Convert custom path alias forms to entity forms, we need to add a BC layer for the route that we're removing here.

Berdir’s picture

  1. +++ /dev/null
    @@ -1,16 +0,0 @@
    -path.admin_overview_filter:
    
    +++ b/core/modules/path/src/PathAliasListBuilder.php
    @@ -0,0 +1,194 @@
    +   */
    +  protected function getEntityIds() {
    +    $query = $this->getStorage()->getQuery();
    +
    +    $search = $this->currentRequest->query->get('search');
    +    if ($search) {
    +      $query->condition('alias', $search, 'CONTAINS');
    +    }
    +
    +    // Only add the pager if a limit is specified.
    +    if ($this->limit) {
    +      $query->pager($this->limit);
    +    }
    +
    +    // Allow the entity query to sort using the table header.
    +    $header = $this->buildHeader();
    

    Interesting, so we're going to keep the custom exposed filters instead of replacing it with a view.

    Specific reason for that or was it just easier to keep that working instead of adding views and upgrade path for it?

  2. +++ b/core/modules/path/src/PathAliasListBuilder.php
    @@ -0,0 +1,194 @@
    +    $build['path_admin_filter_form'] = $this->formBuilder->getForm('Drupal\path\Form\PathFilterForm', $keys);
    

    Could use PathFilterForm::class.

  3. +++ b/core/modules/path/src/PathAliasListBuilder.php
    @@ -0,0 +1,194 @@
    +
    +    // Enable language column and filter if multiple languages are added.
    +    if ($this->languageManager->isMultilingual()) {
    +      $header['language_name'] = [
    +        'data' => $this->t('Language'),
    +        'field' => 'langcode',
    +        'specifier' => 'langcode',
    +        'class' => [RESPONSIVE_PRIORITY_MEDIUM],
    +      ];
    +    }
    

    And we even have a feature here that still doesn't work in views. I guess that was another argument for keeping it hardcoded?

  4. +++ b/core/modules/path/src/PathAliasListBuilder.php
    @@ -0,0 +1,194 @@
    +
    +    // If the system path maps to a different URL alias, highlight this table
    +    // row to let the user know of old aliases.
    +    if ($alias != $this->aliasManager->getAliasByPath($path, $langcode)) {
    +      $row['class'] = ['warning'];
    

    I never even knew that feature existed, doesn't seem very intuitive :)

amateescu’s picture

Fixed the second point :) Not uploading a combined patch because there's no functional change since #15.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

amateescu’s picture

Status: Postponed » Needs review

#3007832: Convert custom path alias forms to entity forms is in, so the patch from #17 should be good to go now :)

amateescu’s picture

Title: [PP-1] Convert the path alias admin overview to a list builder » Convert the path alias admin overview to a list builder
Berdir’s picture

Version: 8.9.x-dev » 8.8.x-dev
Status: Needs review » Reviewed & tested by the community

This looks ready as well, given that testbot agrees.

We're not actually saving any LOC here according to the diffstatt, also because the path alias list has a few special features that we keep, but it removes important usages of AliasStorage methods that we need to remove to be able to deprecate that properly.

It is a bit uncommon to have exposed filters and sorting in a list builder, but adding views integration, specifically for some of the extra features (see #16), would be a lot more work.

plach’s picture

FileSize
165.96 KB

Looks great, just a couple of non-blocking nits!

However, the change in the page title introduced a visual inconsistency that might affect UX:

I'll ask Angie or Gábor about this.

  1. +++ b/core/modules/path/src/PathAliasListBuilder.php
    @@ -0,0 +1,195 @@
    +  public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, RequestStack $request_stack, FormBuilderInterface $form_builder, LanguageManagerInterface $language_manager, AliasManagerInterface $alias_manager) {
    ...
    +    $this->currentRequest = $request_stack->getCurrentRequest();
    ...
    +      $container->get('request_stack'),
    

    Would it make sense to inject the current request directly?

  2. +++ b/core/modules/path/src/PathAliasListBuilder.php
    @@ -0,0 +1,195 @@
    +    $build = $build + parent::render();
    

    += :)

plach’s picture

Status: Reviewed & tested by the community » Needs work

Just spoke with Gábor about this: the inconsistency should be fixed before this lands. We should probably change all user facing labels to "URL alias(es)" to keep the current UX. It may be worth doing that in a separate issue, since that wouldn't be specifically about this page, but not feeling strongly about this.

plach’s picture

Just spoke with @Berdir: I meant that we should change the entity type definition user-facing labels, nothing else. Sorry for the confusion.

amateescu’s picture

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

Fixed #22 / #23 :)

plach’s picture

Looks great, thanks! I will wait for the testbot and then commit, unless someone beats me to it ;)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 25: 3011807-25.patch, failed testing. View results

amateescu’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
17.68 KB
812 bytes

Updated that test.

  • plach committed 55a2b40 on 9.0.x
    Issue #3011807 by amateescu, Berdir: Convert the path alias admin...

  • plach committed 034044b on 8.9.x
    Issue #3011807 by amateescu, Berdir: Convert the path alias admin...

  • plach committed b231e18 on 8.8.x
    Issue #3011807 by amateescu, Berdir: Convert the path alias admin...
plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed 55a2b40 and pushed to 9.0.x and friends. Thanks!

Let's not forget to update the relevant CRs :)

amateescu’s picture

Updated the CR (https://www.drupal.org/node/3013865) to mention the route that has been deprecated here.

Status: Fixed » Closed (fixed)

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