- Issue created by @jurgenhaas
- Merge request !5Issue #3402031: Latest updates break sites on PHP 7.4 β (Open) created by jurgenhaas
- Open on Drupal.org βCore: 9.5.x + Environment: PHP 8.1 & MySQL 5.7last update
about 1 year ago Waiting for branch to pass - Status changed to Needs review
about 1 year ago 7:38am 16 November 2023 - π©πͺGermany jurgenhaas Gottmadingen
Provided an MR to fix this, please review.
- πΊπΈUnited States shelane
It does. See [Β£3400004]. This is why it was changed.
What version of Drupal are you using?
- π©πͺGermany jurgenhaas Gottmadingen
This is happening on one of the last 9.5.11 Drupal sites that the customer has not approved the budget for the update yet.
- Status changed to Closed: won't fix
about 1 year ago 1:26pm 16 November 2023 - πΊπΈUnited States shelane
Drupal 9 minimum php requirements β are php 8. In your case, I would use the patch, but maintainers try to stick with the Drupal requirements.
- Status changed to Active
12 months ago 4:56pm 7 December 2023 - π©πͺGermany jurgenhaas Gottmadingen
@shelane while I see and accept your point about Drupal 9, the declaration of the function's return type is still incorrect. It always returns
MarkupInterface
and never a string. I think this should still be fixed, even if it's for a different reason. - πΊπΈUnited States shelane
Except that it does. I had it as
MarkupInterface
and then an error was reported in the issue I linked in #4. For php 8, we can accept either. - π©πͺGermany jurgenhaas Gottmadingen
That's interesting, because the declaration of
\Drupal\Core\Render\RendererInterface::render
says, that it certainly only returns MarkupInterface.I've checked for implementations of that method, and that's just one:
\Drupal\Core\Render\Renderer::render
. That one returns the result from\Drupal\Core\Render\Renderer::doRender
and that in fact returns empty strings under some circumstances.This looks like a core bug in my view.
- Open on Drupal.org βCore: 9.5.x + Environment: PHP 8.1 & MySQL 5.7last update
12 months ago Waiting for branch to pass - π©πͺGermany jurgenhaas Gottmadingen
I have updated the MR such that it does not declare the return type any longer. That's the only way to keep it working on PHP 7.4 and also make sure that the string return type doesn't cause issue on PHP 8.1 - not sure how we get core to fix the issue at the source, so that all the declarations should be reliable.
- π¦π·Argentina abelpzl
I think a notice should be put on the module page to warn users that this module is not compatible with php 7.4.
This would help avoid problems on sites that cannot yet upgrade to php 8.x / Durpal 10The patch solves the problem in my case.
Cheers!