- Issue created by @andypost
- Status changed to Needs review
over 1 year ago 12:14am 27 June 2023 - last update
over 1 year ago 29,559 pass - 🇫🇷France andypost
Initial patch
Return value is supposed to be
?string
but some places using void - Status changed to RTBC
over 1 year ago 2:51pm 27 June 2023 - 🇺🇸United States smustgrave
Ran the same command from the snippet
git grep _post_update_ |grep sandbox
Applied patch
Ran again
Verified all matches were updated with array - Status changed to Needs work
over 1 year ago 10:16am 28 June 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Should we also do regular update hooks whilst we're here?
grep -ir _update_ core |grep sandbox|grep -E "[0-9+]"|grep NULL core/modules/system/system.install:function system_update_10100(&$sandbox = NULL) { core/modules/system/system.install:function system_update_10101(&$sandbox = NULL) { core/modules/forum/forum.install:function forum_update_10100(&$sandbox = NULL) { core/modules/help/help.install:function help_update_10200(&$sandbox = NULL) { core/modules/block_content/block_content.install:function block_content_update_10100(&$sandbox = NULL): TranslatableMarkup { core/modules/locale/locale.install:function locale_update_10100(&$sandbox = NULL) { core/modules/history/history.install:function history_update_10100(&$sandbox = NULL) { core/modules/statistics/statistics.install:function statistics_update_10100(&$sandbox = NULL) { core/modules/dblog/dblog.install:function dblog_update_10100(&$sandbox = NULL) { core/modules/dblog/dblog.install:function dblog_update_10101(&$sandbox = NULL) { core/modules/tracker/tracker.install:function tracker_update_10100(&$sandbox = NULL) { core/modules/comment/comment.install:function comment_update_10100(&$sandbox = NULL) { core/modules/migrate/migrate.install:function migrate_update_10100(&$sandbox = NULL) {
- Status changed to Needs review
over 1 year ago 1:29pm 28 June 2023 - last update
over 1 year ago 29,562 pass - 🇫🇷France andypost
Sadly it's not possible to use union types with
none
https://3v4l.org/LQPcNSo I set return type to
?TranslatableMarkup
+++ b/core/lib/Drupal/Core/Extension/module.api.php @@ -781,7 +781,7 @@ function hook_update_N(&$sandbox) { +function hook_post_update_NAME(array &$sandbox = []): ?string {
Not sure about
?string
as it actually should be StringableMoreover in ✨ Add Block Content revision UI Fixed result was defined as
TranslatableMarkup
- 🇷🇺Russia Chi
Moreover in #1984588: Add Block Content revision UI result was defined as TranslatableMarkup
TranslatableMarkup implements Stringable.
- Status changed to RTBC
over 1 year ago 2:24pm 28 June 2023 - Status changed to Needs work
over 1 year ago 1:07pm 29 June 2023 - 🇬🇧United Kingdom catch
+++ b/core/lib/Drupal/Core/Extension/module.api.php @@ -765,7 +766,7 @@ function hook_update_N(&$sandbox) { * Stores information for batch updates. See above for more information. * - * @return string|null + * @return \Drupal\Core\StringTranslation\TranslatableMarkup|null * Optionally, hook_post_update_NAME() hooks may return a translated string * that will be displayed to the user after the update has completed. If no
I think this should be string|Stringable|null for bc reasons - not that we're enforcing it but it looks like we might.
- Status changed to Needs review
over 1 year ago 1:28pm 29 June 2023 - 🇫🇷France andypost
@catch it's not for BC, it's for new code - the
module.api.php
is where developers copy/paste so this change will prevent misuse in future and improves API docs - Status changed to RTBC
over 1 year ago 2:52pm 29 June 2023 - Status changed to Needs work
over 1 year ago 2:55pm 29 June 2023 - 🇬🇧United Kingdom catch
We currently specify a string, and if we ever moved update hooks to an interface or similar, we'd probably allow both string and stringable, so I think it should reflect that all three options are allowed.
- Status changed to Needs review
over 1 year ago 6:39pm 29 June 2023 - last update
over 1 year ago Custom Commands Failed - Status changed to Needs work
over 1 year ago 6:08pm 30 June 2023 - 🇺🇸United States smustgrave
This is one of those instances I do wish the tests ran. I'm 99% sure they are fine but can you fix the CC failure.
- Status changed to Needs review
over 1 year ago 2:32am 1 July 2023 - last update
over 1 year ago 29,571 pass - Status changed to RTBC
over 1 year ago 11:30pm 2 July 2023 - last update
over 1 year ago 29,571 pass - last update
over 1 year ago 29,801 pass - last update
over 1 year ago 29,802 pass - last update
over 1 year ago 29,802 pass - last update
over 1 year ago 29,806 pass - last update
over 1 year ago 29,811 pass - last update
over 1 year ago 29,815 pass - last update
over 1 year ago 29,815 pass - last update
over 1 year ago 29,822 pass - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Waiting for branch to pass - last update
over 1 year ago 29,878 pass - last update
over 1 year ago 29,881 pass - last update
over 1 year ago 29,885 pass - last update
over 1 year ago 29,908 pass - last update
over 1 year ago 29,911 pass - last update
over 1 year ago 29,946 pass - last update
over 1 year ago 29,953 pass - last update
over 1 year ago 29,953 pass - last update
over 1 year ago 29,958 pass - 🇳🇿New Zealand quietone
I am doing triage on the core RTBC queue → .
The IS sums up the problem and the solution. All questions have been answered. I don't see that there is anything left to do here. Leaving at RTBC.
I did not review the patch nor adjust credit.
- last update
over 1 year ago 29,958 pass - last update
over 1 year ago 29,958 pass 25:15 24:06 RunningThe last submitted patch, 14: 3370322-14.patch, failed testing. View results →
- last update
over 1 year ago 29,959 pass - Status changed to Needs work
over 1 year ago 10:44am 16 August 2023 - 🇬🇧United Kingdom longwave UK
+++ b/core/modules/views/views.post_update.php @@ -45,14 +45,14 @@ function views_removed_post_updates() { +function views_post_update_oembed_eager_load(?array &$sandbox = []): void { @@ -63,7 +63,7 @@ function views_post_update_oembed_eager_load(?array &$sandbox = NULL): void { +function views_post_update_responsive_image_lazy_load(?array &$sandbox = []): void { @@ -74,7 +74,7 @@ function views_post_update_responsive_image_lazy_load(?array &$sandbox = NULL): +function views_post_update_timestamp_formatter(array &$sandbox = []): void { @@ -85,7 +85,7 @@ function views_post_update_timestamp_formatter(array &$sandbox = NULL): void { +function views_post_update_fix_revision_id_part(array &$sandbox = []): void {
Is there a reason some of these are nullable while others aren't?
- 🇭🇺Hungary czigor
Rerolling #14 for 10.1.x. in case someone else needs it too.