Problem/Motivation
This is a very minor inconvenience, but I noticed while creating a new date time format at /admin/config/regional/date-time , that the link to the php.net documentation of datetime formats is less than ideal. Currently it takes you to: https://www.php.net/manual/en/function.date.php This page does not actually have the formats table the user will be looking for. I believe it should take you here instead: https://www.php.net/manual/en/datetime.format.php
Searching the Drupal core codebase for "https://www.php.net/manual/en/function.date.php" reveals that this is an inconvenience in multiple places throughout core.
Proposed resolution
There is one remaining link, in core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php.
Replace https://www.php.net/manual/en/function.date.php with https://www.php.net/manual/datetime.format.php.
Remaining tasks
Make a patch
Review
Commit
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#8 | 3196433_3.png | 49.81 KB | adalbertov |
#6 | 3196433-6.patch | 693 bytes | ayushmishra206 |
#4 | 3196433_2.png | 44.48 KB | John Less |
#4 | 3196433_1.png | 65.67 KB | John Less |
#3 | 3196433-link-to-php.net_.patch | 887 bytes | richa_porwal |
Comments
Comment #2
quietone CreditAttribution: quietone as a volunteer commentedThis looks like a duplicate.
Yes, it has been fixed in #3172582: Update PHP manual link for date/time formatting help and committed to 9.1.x. It could only be committed there because string changes were required.
However, grepping locally there is still an instance of http://php.net/manual/function.date.php in FieldDateTest.php. It was removed from the patch for the other issue in this comment
I don't see why being in a comment matters, the link it incorrect and should change.
Let's use this issue to make that change to core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php:
This is s suitable novice task.
Comment #3
richa_porwal CreditAttribution: richa_porwal at Asentech LLC for Asentech LLC commentedHi Team,
I have created patch for the above problem motivation. Need review
Comment #4
John Less CreditAttribution: John Less as a volunteer commentedPatch applied and URL, accessed the documentation site correctly.
Comment #5
alexpottThe comment that needs fixing is
// ISO 8601 format, see http://php.net/manual/function.date.php
in core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php on Drupal 9. The string that is being changed in #3 is already fixed in Drupal 9.Comment #6
ayushmishra206 CreditAttribution: ayushmishra206 at OpenSense Labs commentedMade the change, please review.
Comment #7
ayushmishra206 CreditAttribution: ayushmishra206 at OpenSense Labs commentedComment #8
adalbertov CreditAttribution: adalbertov at CI&T commentedI have test patch #6, it looks ok.
Comment #9
alexpott@adalbertov thank you for looking into this issue.
Posting screenshots of your codebase or CLI does not advance the issue, since the automated testing infrastructure tells us whether the patch applies correctly.
So, I've removed the issue credit for that screenshot. In the future, you can get credit for issues by reading the issue to understand its purpose, and posting your review or testing of that purpose. Thank you!
Comment #10
alexpottCommitted and pushed 9f7b53f058 to 9.2.x and dbd8305ef0 to 9.1.x. Thanks!