Problem/Motivation

I had to use protocol-less URL in my content and drupal allowed me to save my content without giving any errors and not even a log message.

After saving I checked my node and clicked in the link I've just created. The page loops to itself.

STEPS to reproduce:

  1. Add field of the type 'link' in article content type
  2. Add a content of the type 'Article'
  3. In the link field, add a link like: '//www.google.com'
  4. Hit save and check the node
  5. Click on the link saved

Actual result:

The link redirects to the page itself.

OBS: I noticed the problem on 8.3.4 version. We could check if the problem exists on dev version.

Proposed resolution

Given that Link module in D7 doesn't allow you to use protocol-less urls, and a error are displayed to the user, we could add this to D8 also. Think about people that doesn't know about protocol-less and are trying to use in their contents, if they don't check the link properly, the link will redirects to the nade itself. So , if it's prossible:

a) Add a drupal error saying to the users that he can't use those kinds of URLs, or

b) Allow the use of these URLs.

And we could add a event log to the log messages.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Yago Elias created an issue. See original summary.

Yago Elias’s picture

Yago Elias’s picture

FileSize
63.85 KB

Log is clean.
evidence2

Version: 8.3.4 » 8.3.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Version: 8.3.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. Branches prior to 8.8.x are not supported, and 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.

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
quietone’s picture

Issue tags: +Bug Smash Initiative

I tested on Drupal 9.4.x, standard install, and can confirm the problem still exists.

Tagging and adding to #3188110: [Meta] Improve URL validation

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.