Problem/Motivation

The validation for path aliases should be the same whether saving through the admin interface (admin/config/search/path) or node edit forms. As identified in #1847174: Path alias validation should test for relative path, no trailing slash requirements, however, each of those has its own completely separate validation handler and automated tests, and they all behave a little different:

Validation handler Automated tests
Admin form path_admin_form_validate() PathAliasTest::testAdminAlias()
Node edit form path_form_element_validate() PathAliasTest::testNodeAlias()

Proposed resolution

The validation logic should be consolidated--perhaps extracted into a nice, unit-testable utility function. The duplicativeness of the automated tests should be addressed, as well.

Remaining tasks

Fix, review, etc.

User interface changes

None.

API changes

tbd

Comments

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

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

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

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

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

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.

dawehner’s picture

Priority: Normal » Critical
Issue summary: View changes

I think we have a bit of a big problem here. Let me update the issue summary what this leads to.
I set it to critical as you can easily destroy the complete Drupal UI.

catch’s picture

catch’s picture

Category: Bug report » Task
Priority: Critical » Normal
Issue summary: View changes
Related issues: +#121362: Require dedicated permission(s) to set aliases pointing to existing or reserved paths

Discussed this with xjm, effulgentsia and cottser. We agreed the issue of overriding existing paths is a duplicate of #121362: Require dedicated permission(s) to set aliases pointing to existing or reserved paths so removing that from the summary.

Unifying the validation and test coverage seems like a good normal task to do, so downgrading to that.

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

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

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

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

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

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

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

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

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

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

danflanagan8’s picture

Status: Active » Closed (outdated)
Issue tags: +Bug Smash Initiative

I wonder what the status of this issue is...

path_form_element_validate() appears to have been removed in #2201051: Convert path.module form alters to a field widget

path_admin_form_validate() appears to have been removed in #1987802: Convert path_admin_overview() to a new style controller

So the IS at least is outdated.

Digging deeper, both the Admin form and the Node edit form use the PathWidget nowadays. The Node edit form was modified to use the widget in #2201051: Convert path.module form alters to a field widget. The admin form was modified to use the widget in #3007832: Convert custom path alias forms to entity forms.

It looks to me that both the Node edit and the Admin form are using the same validation these days, so I'm going to mark this as outdated.

As for the test coverage, I'm of the mind that there's no harm in testing both the Node form and the Admin form. There's more than validation being tested in the PathAliasTest functional tests.

If anyone wants to re-open, please do so with details. Thanks!