This check is not relevant on the CLI and causes an error on Drush, for example.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 2931883-12.patch | 760 bytes | David_Rothstein |
| always.patch | 737 bytes | moshe weitzman |
This check is not relevant on the CLI and causes an error on Drush, for example.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 2931883-12.patch | 760 bytes | David_Rothstein |
| always.patch | 737 bytes | moshe weitzman |
Comments
Comment #2
moshe weitzman commentedComment #3
wim leers#2456025: PHP warnings in PHP 5.6 because of always_populate_raw_post_data ini setting added that check.
Comment #4
wim leersThis is because the PHP CLI has different settings, right? But then how can
rest_requirements()actually require that this setting has a certain value? I think you're saying it can't?Comment #5
wim leersComment #6
moshe weitzman commentedThere is no such thing as a POST on a CLI request. So my patch restricts the error to just web requests.
Comment #7
wim leersRight: there is no POST in CLI, because there is no HTTP in CLI. I'm not questioning that.
But this is a
php.iniconfiguration check that's necessary for the REST module to function correctly (apparently, I'd never seen it before). My concern is that making the change you proposed means that usingdrush en -y restwill now not do the necessary requirements checking.Comment #8
wim leersHm, apparently
always_populate_raw_post_datais removed in PHP 7, and it never affected REST functionality, only tests. And the two affected tests no longer exist, they've been refactored away.AFAICT this is a pure PHP bug work-around, so we should probably keep it until Drupal requires PHP >=7.
This issue is filed against Drupal 9. I think you want this to land in the next Drupal 8 minor though?
Comment #9
moshe weitzman commentedI suggest doing a hook_requirements for phase==runtime and not phase ==install. And of course, omit CLI requests per the patch.
Comment #10
wim leersSound good to me! I see no reason why this could not land in 8.4 already, since this is a simple bugfix with no behavioral impact on existing sites.
Comment #11
David_Rothstein commentedIf that's true, this requirements check could just be removed entirely. (But based on reading #2456025: PHP warnings in PHP 5.6 because of always_populate_raw_post_data ini setting it sounds like there might be a real effect somewhere; it is hard to tell.)
It would be nice to just remove the code - it's somewhat suspect anyway (since it enforces a particular solution which isn't even the most backwards-compatible one that the PHP developers recommend; they seem to recommend simply turning off
display_startup_errorsin production).But just making it a runtime-only error (and non-CLI) does sound good as a first step.
Comment #12
David_Rothstein commentedQuick patch (untested) that just does what was suggested above (runtime-only and non-CLI).
Comment #13
moshe weitzman commentedLGTM, and green. Thanks.
Comment #14
wim leersRTBC++
Comment #15
larowlanCrediting @WimLeers as the discussion and reviews here shaped the patch
Moving to 8.5.x, as per https://www.drupal.org/core/release-cycle-overview#current-development-c... 8.4 is in 'critical fixes only', so this can't be backported to 8.4
Comment #16
larowlanCommitted as 0428e20 and pushed to 8.5.x.
Comment #18
wim leers@larowlan: doesn't "criticals only for current minor" start when the beta of the next minor is released?
Comment #19
larowlanHi Wim,
I checked with the release managers just to be sure, but definitely 8.4.5 will be criticals only.
Lee
Comment #21
David_Rothstein commentedCreated a followup issue to discuss removing this check entirely.