Problem/Motivation
While downloading a Drupal 9 codebase using composer, found the following D8-specific documentation URL mentioned in the post-create-project step of the composer drupal/recommended-project template: https://www.drupal.org/docs/8/install
...
Next steps:
* Install the site: https://www.drupal.org/docs/8/install
...
In that specific case, it would be better to replace that URL with https://www.drupal.org/docs/installing-drupal, which is a more generic version of those steps.
As mentioned by drumm, there are more of such URLs, in the Drupal 9.x codebase:
https://git.drupalcode.org/search?group_id=2&nav_source=navbar&project_i...
Found 7 occurrences of that URL in the following files, on the 9.3.x codebase:
composer/Template/LegacyProject/composer.json
composer/Template/RecommendedProject/composer.json
core/lib/Drupal/Core/DrupalKernel.php
core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
core/modules/system/system.install
core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
And that result is just for the 'docs/8/install' path.
(Searching for "docs/8/" in the 9.3.x branch, we get 100 results:
https://git.drupalcode.org/search?group_id=2&nav_source=navbar&project_i...
Probably we need to deal with those as well, in a separate issue).
Steps to reproduce
As mentioned here: https://www.drupal.org/docs/develop/using-composer/using-composer-to-ins...,
use composer to create a fresh D9 codebase, with the following command:
composer create-project drupal/recommended-project my_site_name_dir
You will see the D8-specific URL in the post-create-project steps displayed at the end of the command output, as mentioned above.
You can also find the links by searching the codebase for the string 'docs/8/install'.
If on a Mac/Linux, you can use the following grep command after you 'cd' into the codebase folder:
grep -irn 'docs/8/install' ./
Proposed resolution
Find and replace all such URLs with more generic equivalents.
Issue fork drupal-3248078
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
antojoseComment #3
quietone commentedAdding related issue.
@antojose, can you provide a grep command for find the URLs to fix. and add it to the Steps to Reproduce? That will be needed for reviewers and others wanting to help out here. Thanks
Comment #4
quietone commentedDoes anyone mind a more succinct title?
Comment #5
antojose@quietone, Updated the description with details on the grep command to be used.
Comment #6
antojoseI think I might have messed up the issue fork branch:
https://git.drupalcode.org/issue/drupal-3248078
Any way to delete and re-create the branch if that's the case?
Comment #8
rootworkTagging this as a Novice task for anyone who is able to search the codebase, whether with grep (as suggested) or any other method.
Task 1: Since it's been some time since this was last touched, some or all of these references may have been taken care of -- so the first step is to see if they are still present. If they are, provide an itemized list.
Task 2: Subsequently, the same person or a different person could then create a Merge Request addressing whatever items turn up in the first task.
Comment #9
uri_frazierHello! I'm working on this issue at Portland DrupalCon 2022 during a "First Time Contributor Workshop".
Comment #10
alison[mentoring] Working with Uri on this issue 👋
Comment #12
uri_frazierRe-ran the grep command (grep -irn 'docs/8/install' ./) against 9.4.x codebase there are no new references that weren't taken care of in the commit by @antojose.
Comment #13
uri_frazierComment #15
uri_frazierComment #17
uri_frazierRan into some functional test errors (for merge request 2209) and realized it was because our fork was based off of 9.3.x and I needed to rebase /get changes from 9.4.x since that's what the tests were built for.
Had to rebase (2x), and hopefully all tests will pass now.
Comment #20
uri_frazierComment #21
rootworkLooks good! I can't say that I grepped the source to see if any 8.x links were missed since that was the point of the task, but assuming they were all included then I can confirm all the links are now correct.
Comment #24
catchCommitted/pushed to 10.1.x and cherry-picked back through to 9.4.x, thanks!
Comment #27
xjmI reverted this from 9.4.x because it breaks a couple of translatable strings, which should be a minor-only change. I think fixing redirects is not worth forcing translators to re-translate these strings in a bugfix release.
It will still be in 9.5.x and if we wanted we could backport the non-string-breaking changes to 9.4.x. Marking fixed for now, but if contributors would like to supply a docs-only patch for 9.4.x and set the issue to NR on 9.4.x for that, that would be OK too.
Comment #28
catchMissed that that URL wasn't in a placeholder, so I've opened an issue to put it in one: #3295430: Change inline URLs to placeholders in interface text.