Problem/Motivation

Currently, two places in core about the PHP requirements link https://www.drupal.org/docs/9/how-drupal-9-is-made-and-what-is-included/... and refer to it as the "Environment requirements of Drupal 9". That was a temporary page for Drupal 9 development and has since been deprecated.

A third place links the old Drupal-8-specific URL alias, https://www.drupal.org/docs/8/system-requirements/php, and furthermore even refers to it as the "Drupal 8 PHP requirements handbook page", which is truly confusing on Drupal 9.

The correct link is https://www.drupal.org/docs/system-requirements/php-requirements.

Proposed resolution

Use the correct link, and refer to it as the "Drupal PHP requirements" (without any specific major version) since it now covers all (8+) major versions. That way the documentation doesn't constantly get stale and out of sync.

User interface changes

String changes to link text for three strings. Current link is used in all three places.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Comments

xjm created an issue. See original summary.

xjm’s picture

Status: Active » Needs review
StatusFileSize
new3.77 KB
gábor hojtsy’s picture

Looks good. Since we are changing this string, it would be great to move the PHP.net link to a placeholder as well, so we can change it if need be without needing to change the translations and also to make sure translators don't change it accidentally.

xjm’s picture

Thanks @Gábor Hojtsy. Regarding:

Since we are changing this string, it would be great to move the PHP.net link to a placeholder as well, so we can change it if need be without needing to change the translations and also to make sure translators don't change it accidentally.

PHP.net is available in multiple languages, so that's why links to it (here and elsewhere) are purposefully included in the string itself. That way, translators can change it from the English translation to the local translation. (At least, that's what we've discussed the previous times these and similar links have been updated.)

I'm open to changing that, especially if the localization behavior of PHP.net itself has gotten smarter in recent years, but I think that's out of scope here because there are many other places in core where we put the PHP.net link in the string itself rather than a placeholder.

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

https://www.php.net/supported-versions.php is not within the manual. The manual is available in multiple languages but other pages are not. (I was heavily involved 20 years ago to create the php.net docs translation system, see https://www.php.net/manual/en/preface.php#contributors, and it still seems to use mostly the same system logic :D)

I understand there may be other links in core to non php.net manual pages though.

The patch looks good then :)

xjm’s picture

Posted #3261623: Decide whether to move various PHP.net links into placeholders rather than the string itself in case we want to discuss more what links go into the strings vs. not (for PHP.net or generally).

quietone’s picture

The changed strings are correct and it is an improvement, it removes 'handbook' from the strings as well as updating Drupal version as needed. I applied that patch and checked the links - all good.

It is odd that the string in system.install uses the possessive form with PHP but not with Drupal, and Drupal has 'page' following it and PHP doesn't. Since that is the way the original string is, that does not block this being committed.

I also wonder if the category is 'documentation' or 'user interface text'.

I discussed the first item with xjm on a call. She immediately pointed out there is a reason the term "PHP's" is used. And then walked through finding the issue that introduce the possessive form to this string. The key feature of the git archaeology was using 'git log -L', in this case git log -L198,204:core/modules/system/system.install. From that she found the comment before the change. That and the following comment explains that the possessive is used to make it clear that this is the official PHP documentation and not documentation for Drupal or an HSP.

We discussed making a followup to consider changing the use of the possessive form. While I don't like "PHP's" I can live with it and would have left it at that. But xjm did the right thing and considered if it fit in the scope of existing issues and found #3261606: Provide more specific messaging about the consequences of using an unsupported PHP version. I'll make a comment there about whether to use "PHP's" or not.

The question about category was missed. Will get to that next.

quietone’s picture

Component: documentation » user interface text

xjm responded in Slack that she agrees with changing the component.

edit: fix typo

xjm’s picture

StatusFileSize
new3.9 KB

@quietone noticed that the patch does not apply to 10.0.x. (This is because the installer hardcodes the PHP version in this string, so of course it is different for the different PHP requirement.)

Here's a 10.0.x version.

xjm’s picture

Saving issue credits.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: php-3261611-d10-9.patch, failed testing. View results

xjm’s picture

https://www.drupal.org/pift-ci-job/2312407 shows a fail in rupal\Tests\layout_builder\FunctionalJavascript\ContentPreviewToggleTest, which is one of the JS tests with an increased fail rate recently. It has failed in HEAD 10 times in the past week on various environments and branches. See reference to it in #2829040-142: [meta] Known intermittent, random, and environment-specific test failures.

Therefore, queuing another test run.

xjm’s picture

Status: Needs work » Reviewed & tested by the community

(Just undoing the bot fail.)

quietone’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/install.php
@@ -30,7 +30,7 @@
+  print 'Your PHP installation is too old. Drupal requires at least PHP 8.0.2 See <a href="http://php.net/supported-versions.php">PHP\'s version support documentation</a> and the <a href="https://www.drupal.org/docs/system-requirements/php-requirements">Drupal PHP requirements</a> page for more information.';

Oops, this is missing the period at the end of 8.0.2.

xjm’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new3.77 KB
new924 bytes

Addressing #14.

Since it is the smallest theoretically possible change, going to go ahead and re-RTBC assuming tests pass etc.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs a reroll because in the meantime the minimum PHP version of Drupal 10 has changed.

suresh prabhu parkala’s picture

StatusFileSize
new3.77 KB

A re-rolled patch against the latest 9.4.x.

suresh prabhu parkala’s picture

Status: Needs work » Needs review
ranjith_kumar_k_u’s picture

StatusFileSize
new3.76 KB

Re-rolled #17 for 10.0.

ranjith_kumar_k_u’s picture

StatusFileSize
new3.76 KB
alexpott’s picture

Re #17 - the D9 patch in #2 is still the correct patch for Drupal 9. The minimum PHP version has not changed there yet and the message in #17 is not consistent with the check immediately above it.

alexpott’s picture

Here's an idea for how to make things a bit simpler in the future when minimum PHP changes... opened as a follow up... #3266523: Use core/composer.json to get minimum PHP in install.php.

quietone’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll

I applied the 9.4.x patch and did the following search

$ grep -r "docs/8/system-requirements" core
core/modules/system/system.install:        ':drupal-php' => 'https://www.drupal.org/docs/8/system-requirements/php-requirements',
core/modules/system/system.install:      'description' => t('You are running on a system where PHP is compiled or limited to using 32-bit integers. This will limit the range of dates and timestamps to the years 1901-2038. Read about the <a href=":url">limitations of 32-bit PHP</a>.', [':url' => 'https://www.drupal.org/docs/8/system-requirements/limitations-of-32-bit-php']),

The title here is to fix the PHP requirements links so I think it is within scope for fix these references as well.

andregp’s picture

StatusFileSize
new1.4 KB
new5.09 KB

Replaced the remaining links from the 9.4.x patch as per #23.
(I used the patch #2 as the base for the interdiff because @alexpott commented that "patch in #2 is still the correct patch for Drupal 9". (see #21)).

andregp’s picture

Status: Needs work » Needs review

I forgot to update the status.

quietone’s picture

Status: Needs review » Needs work

Patch failed to apply.

andregp’s picture

Status: Needs work » Needs review
StatusFileSize
new5.03 KB
new3.79 KB

@quietone sorry, my repo wasn't up to date.
Here is the patch.

quietone’s picture

Status: Needs review » Needs work

@andregp, no worries. I reckon we have all done that.

The patch in #27 for 9.4.x looks good, I applied and checked using the grep command in #23.

Now we need a patch for 10.0.x

ravi.shankar’s picture

Status: Needs work » Needs review
StatusFileSize
new5.03 KB

Added a parch for Drupal 10.0.x.

murilohp’s picture

Status: Needs review » Reviewed & tested by the community

I was reviewing #29, and did the following searches:

The first one is the same from #23
$ grep -r "docs/8/system-requirements" core
No results, so it's fine.

The second search was:

$ grep -r "drupal-9" core
core/UPDATE.txt: https://www.drupal.org/docs/9/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/upgrading-a-drupal-8-site-to-drupal-9
core/modules/system/system.install:   ':url' => 'https://www.drupal.org/docs/9/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/upgrading-a-drupal-8-site-to-drupal-9',

My idea was to find any references of drupal 9(of course I found a lot but the two results above got me), I know this is not part of the scope of this issues, but do you have any issue to address the update of the links above(for D10 only)?

The patch looks good, the testbot is happy so it's RTBC for me!

FYI: If you're trying to test the patches locally and you composer is generating a platform_check.php with the correct PHP version expected (eg: 8.1 for d10 and 7.3 for d9) you can hack the file just to see the drupal messages being displayed in your screen.

quietone’s picture

@murilohp, thanks for the review and RTBC. I don't think there is a specific issue for D10, there is a Meta though, #2855175: [META] Many documentation / handbook URLs redirect to D7 content.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 29: 3261611-29.patch, failed testing. View results

xjm’s picture

Status: Needs work » Reviewed & tested by the community

HEAD was broken for 10.0.x. Retesting and restoring status.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 29: 3261611-29.patch, failed testing. View results

andregp’s picture

Status: Needs work » Reviewed & tested by the community

Another random failure. The retest passed so restoring status.

xjm’s picture

For #30, some work needs to be done to make that handbook section include updates to D10. I'll file a followup.

murilohp’s picture

Thanks for the responses @quietone and @xjm!

quietone’s picture

All feedback has been addressed, including making a followup for wiki changes.

This looks ready to commit to me. I'll wait for another committer to confirm.

  • c4cdb61 committed on 10.0.x
    Issue #3261611 by xjm, andregp, ranjith_kumar_k_u, Suresh Prabhu Parkala...

  • 2d05361 committed on 9.4.x
    Issue #3261611 by xjm, andregp, ranjith_kumar_k_u, Suresh Prabhu Parkala...
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Woot, thanks all! Committed to 10.x and 9.4.x.

Status: Fixed » Closed (fixed)

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