- First commit to issue fork.
- @deepakkm opened merge request.
- @rajeshreeputra opened merge request.
- Status changed to Needs review
over 1 year ago 10:12am 8 March 2023 - π¬π§United Kingdom alexpott πͺπΊπ
Afaics some of the fixes being applied here were done in π Deprecated function: strpos() in layout_builder_entity_view_alter Fixed .
There are way too many MRs on this issue but also AFAICS the fix to LayoutBuilderUiCacheContext won't actually fix the problem. I think the fix should be something like;
return 'is_layout_builder_ui.' . (int) !str_starts_with($this->routeMatch->getRouteName() ?? '', 'layout_builder.');
i.e. adding
?? ''
to cope with situation where getRouteName() returns a NULL. It'd be interesting to understand when this function is being called at there is no route match. - π·π΄Romania claudiu.cristea Arad π·π΄
@alexpott, The idea of casting to
(int)
was rejected by @xjm in #17, #21, #24 - π·π΄Romania claudiu.cristea Arad π·π΄
Discussed in Slack with @alexpott and will rebase against 10.1.x
- π·π΄Romania claudiu.cristea Arad π·π΄
Re #42 π [PHP 8.1] Deprecated function: strpos(): Passing null to parameter #1 LayoutBuilderUiCacheContext.php on line 28 Fixed
I think the fix should be something like;
return 'is_layout_builder_ui.' . (int) !str_starts_with($this->routeMatch->getRouteName() ?? '', 'layout_builder.');i.e. adding ?? '' to cope with situation where getRouteName() returns a NULL. It'd be interesting to understand when this function is being called at there is no route match.
Discussed with @alexpott on Slack and we agreed that the fix, currently in merge request 3587, is correct and fulfills also the requirement from #17 π [PHP 8.1] Deprecated function: strpos(): Passing null to parameter #1 LayoutBuilderUiCacheContext.php on line 28 Fixed .
This is ready for a final review.
- Status changed to RTBC
over 1 year ago 9:11pm 9 March 2023 - π¦πΊAustralia acbramley
Following the discussion in slack, it seems like this doesn't need a test so the fix looks good to me.
- Status changed to Fixed
over 1 year ago 9:30pm 9 March 2023 - π¬π§United Kingdom alexpott πͺπΊπ
Committed 341af8bf30 and pushed to 10.1.x. Thanks!
Committed and pushed 9dd37aa3ee to 10.0.x and 067b544dfd to 9.5.x. Thanks! -
alexpott β
committed 341af8bf on 10.1.x
Issue #3313342 by Rajeshreeputra, idimopoulos, claudiu.cristea, deepakkm...
-
alexpott β
committed 341af8bf on 10.1.x
-
alexpott β
committed 9dd37aa3 on 10.0.x
Issue #3313342 by Rajeshreeputra, idimopoulos, claudiu.cristea, deepakkm...
-
alexpott β
committed 9dd37aa3 on 10.0.x
-
alexpott β
committed 067b544d on 9.5.x
Issue #3313342 by Rajeshreeputra, idimopoulos, claudiu.cristea, deepakkm...
-
alexpott β
committed 067b544d on 9.5.x
- π¬π§United Kingdom alexpott πͺπΊπ
Somehow this got unpublished
- πΊπΈUnited States jmester13
Hey All,
I've got a instance where this merge request is failing upon Composer update and I'm wondering is anyone else is running into that issue. Below is the error I'm getting from composer, running on Acquia.
https://git.drupalcode.org/project/drupal/-/merge_requests/2601.patch (3301770 - Passing null to parameter to strpos() is deprecated with PHP8.1) Could not apply patch! Skipping. The error was: Cannot apply patch https://git.drupalcode.org/project/drupal/-/merge_requests/2601.patch
In PluginManager.php(274) : eval()'d code line 331: Cannot apply patch 3301770 - Passing null to parameter to strpos() is deprecated with PHP8.1 (https://git. drupalcode.org/project/drupal/-/merge_requests/2601.patch)!
I'm just running composer install or composer update and getting this issue.
Thanks all.
- π·π΄Romania claudiu.cristea Arad π·π΄
@jmester13, there are new releases for 9.5, 10.0 and 10.1. You don't need the patch anymore, jut use the latest Drupal version.
- πΊπΈUnited States jmester13
@claudiu.cristea
Thanks for the quick reply. I am already on 9.5.3.
I've ensured I don't have this patch in my composer file and have removed the composer.lock file and vendor directory.
I've actually tried removing the few core patches I had and am still getting this error.
Then I removed all my patches, vendor, composer.lock and removed the composer caches.
Still getting the error and seeing that the composer.lock that is generated contains the core patch.
Seems I have an oddity, any chance anyone else has been in this position. If not I'll try and check in with the folks at Acquia and see if it's something that is system related. But it almost seems that core is failing to patch itself or something?
Latest Composer log below.
Thanks all.
- Installing phpunit/phpunit (9.6.5): Extracting archive
- Applying patches for drupal/core
https://www.drupal.org/files/issues/2019-12-28/3082690-80.patch β (3059955 - It is possible to overflow the number of items allowed in Media Library)
https://www.drupal.org/files/issues/2022-11-11/3222107-2.patch β (3222107 - jQuery UI library order is incorrect when a large number of javascript files is loaded between two jQuery UI libraries)
https://git.drupalcode.org/project/drupal/-/merge_requests/2598.patch (3301692: Passing null to parameter to mb_strtolower() is deprecated with PHP 8.1)
https://git.drupalcode.org/project/drupal/-/merge_requests/3143.patch (3313342 - [PHP 8.1] Deprecated function: strpos(): Passing null to parameter #1 LayoutBuilderUiCacheContext.php on line 28)
Could not apply patch! Skipping. The error was: Cannot apply patch https://git.drupalcode.org/project/drupal/-/merge_requests/3143.patchIn Patches.php line 331:
Cannot apply patch 3313342 - [PHP 8.1] Deprecated function: strpos(): Passing null to parameter #1
LayoutBuilderUiCacheContext.php on line 28 (https://git.drupalcode.org/project/drupal/-/merge_req
uests/3143.patch)! - π·π΄Romania claudiu.cristea Arad π·π΄
@jmester13, latest is 9.5.5
- @rajeshreeputra opened merge request.
- π·π΄Romania claudiu.cristea Arad π·π΄
Crediting @acbramley as he contributed with the review
Automatically closed - issue fixed for 2 weeks with no activity.