This module was created to prevent content managers from accidentally triggering pathauto's handling of duplicate url aliases.
Basically, imagine the following scenario:
An entity type is set up with a pathauto pattern ending in /[node:title]
A content manager is asked to create an entity of this type with the following title: "Example Title". They publish the entity and the following url alias is generated /example-title
Two years later, another content manager is asked to create another node of the same content type with the same title, "Example Title". The content manager publishes the entity as requested, however this time the generated url is /example-title-0.
Nobody notices the issue with the url alias, and premade email blasts go out instructing users to visit /example-title. Sadness ensues.
This module creates a form validator capable of detecting if a duplicate url alias would be generated on save, and if so, fire an error message and prevent save.
Project link
| Comment | File | Size | Author |
|---|---|---|---|
| Screen Shot 2022-08-30 at 10.10.59 AM.png | 563.59 KB | mdranove |
Comments
Comment #2
mdranove commentedComment #3
vishal.kadamThank you for applying! Reviewers will review the project files, describing what needs to be changed.
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.
To reviewers: Please read How to review security advisory coverage applications, What to cover in an application review, and Drupal.org security advisory coverage application workflow.
While this application is open, only the user who opened the application can make commits to the project used for the application.
Reviewers only describe what needs to be changed; they don't provide patches to fix what reported in a review.
Comment #4
vishal.kadamFix PHPCS issues.
Comment #5
mdranove commentedHello Vishal, all errors have been fixed on newly tagged release 1.1.1.
1 warning remains, intend to leave as is:
Comment #6
mdranove commentedComment #7
vishal.kadam1. Remove the LICENSE.txt file. The LICENSE file isn't necessary. It will be added automatically by the packaging script.
2. Replace README.txt with README.md file. Please take a moment to make your README.md follow the guidelines.
Comment #8
mdranove commentedTagged and released v1.1.2 with the following:
1. Removed license.txt
2. Replaced Readme.txt with Readme.md based on drupal guidelines.
Comment #9
mdranove commentedComment #10
vishal.kadam@mdranove,
I have reviewed the changes, and they look fine to me.
Let’s wait for other reviewers to take a look and if everything goes fine, you will get the role.
Thanks
Comment #11
a.kovrigin commentedIt is a great idea to notice content managers about this behaviour.
The following are not actually a security but general advices:
return $original_alias != $alias;so you won't need to use isset() in the validation functionComment #12
mdranove commentedThanks for the feedback @a.kovrigin. I have incorporated some of your suggestions on release 1.1.3 , but not all. Response below:
Comment #13
hitchshockManual Review
Create composer.json and add a correct license, e.g. GPL-2.0-or-later
Extra comments/proposals:
'#default_value' => $this->t($default_error_msg),- this is an incorrect implementation here. You shouldn't translate the default value and config setting with t(). You have to implement a translatable config instead. For that, you have to create a correct translatable schema. Afterward, you will be able to translate this config setting via Configuration Translation module@param \Drupal\Core\Entity\EntityInterface $entity(missed \ before Drupal)This review uses the Project Application Review Template.
Extra things
Comment #14
mdranove commentedHello, thank you for the feedback.
Feedback has been incorporated into release 1.1.4.
Validation for taxonomy terms is not supported yet, but will take it into consideration for the future.
Comment #15
mdranove commentedComment #16
avpaderno@mdranove As a side note, it is not necessary to create a new tag, a new release, nor a new branch every time that what reported has been changed. Commit the changes in the same branch without creating tags or releases.
Comment #17
avpadernoA correct branch ends with the literal .x. (x is not a placeholder for a number.)
Please commit the last changes in the 1.1.x branch. The other branches, like 1.1.4. do not have a correct name.
Comment #18
avpadernoAs side note, please check Git on your computer is set to use the same email associated to your drupal.org account, or the commits are not associated to your account.
Comment #19
mdranove commented@apaderno,
Thank you for the feedback, I have gone ahead and merged the most recent changes into branch 1.1.x.
Comment #20
mdranove commentedComment #21
avpadernoclass UniqueAliasCheckerSettingsForm extends ConfigFormBase implements ContainerInjectionInterface {That interface is already implemented by the parent class. There is no need to repeat
implements ContainerInjectionInterface.Comment #22
avpadernoThank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the Slack #contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the reviewers.
Comment #23
avpaderno