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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

maskedjellybean created an issue. See original summary.

quietone’s picture

Title: Links to php.net datetime formats documentation incorrect » Link to php.net datetime formats documentation incorrect in FieldDateTest.php
Issue summary: View changes
Issue tags: +Novice
Related issues: +#3172582: Update PHP manual link for date/time formatting help

This 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

The link within FieldDateTest.php is not altered as it appears in comment, thus should be left out.

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.

richa_porwal’s picture

Status: Active » Needs review
FileSize
887 bytes

Hi Team,

I have created patch for the above problem motivation. Need review

John Less’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
65.67 KB
44.48 KB

Patch applied and URL, accessed the documentation site correctly.

alexpott’s picture

Version: 8.9.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Needs work

The 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.

ayushmishra206’s picture

Made the change, please review.

ayushmishra206’s picture

Status: Needs work » Needs review
adalbertov’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
49.81 KB

I have test patch #6, it looks ok.

alexpott’s picture

@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!

alexpott’s picture

Component: user interface text » documentation
Status: Reviewed & tested by the community » Fixed

Committed and pushed 9f7b53f058 to 9.2.x and dbd8305ef0 to 9.1.x. Thanks!

  • alexpott committed 9f7b53f on 9.2.x
    Issue #3196433 by ayushmishra206, erricha, quietone: Link to php.net...

  • alexpott committed dbd8305 on 9.1.x
    Issue #3196433 by ayushmishra206, erricha, quietone: Link to php.net...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.