Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
extension system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2023 at 15:01 UTC
Updated:
25 Sep 2026 at 16:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #4
smustgrave commentedhttps://www.drupal.org/node/3210925 removed update_set_schema
also crediting quietone for doing all the work.
Comment #5
smustgrave commentedWould be nice to get this in first before the others to avoid merge conflicts in the new Update.php file.
Comment #6
xjmThis is presumably mostly just removed code, so I focused on the top-level naming and documentation. Few things to fix there.
This kind of issue would normally require subsystem maintainer review, but the database update system does not have a maintainer. So, in lieu of that, it gets escalated to framework managers. Thanks!
Comment #7
larowlanLeft a review
Comment #11
mradcliffeI finished the rebased and then worked on fixing phpcs and phpstan issues, and resolving review comments
I think the only comment that is pending is a question about making the
doOnemethod static. This would require no longer calling object methods in that method and using static\Drupalcalls.I'll set this to Needs review, but it may not pass tests.
Comment #12
nicxvan commentedA couple of failures and comments.
I think one call was missed.
Why would we make doOne static?
Comment #13
mradcliffeI fixed the update service and the suggestion from @nicxvan. Then I added a static method to instantiate the class for batch callbacks, and changed the doOne method to protected per @larowlan's review in 2024.
I think the other review comments can be resolved once someone reviews them.
Comment #14
mradcliffeMore test failures so back to Needs work.
Comment #15
nicxvan commentedI'll take a look but there are some relevant test failures.
Comment #16
mradcliffeI fixed the kernel test. Then on self-review, I found some more missing doc block issues from where I picked up the merge request, and fixed those too.
FunctionalJavaScript tests are randomly failing throughout core.
Should the doc blocks in update.inc be truncated to avoid duplicate information?
Comment #17
mradcliffeComment #18
mradcliffeComment #19
dcam commentedI found some things that need attention. I left comments on the MR.
I didn't leave an MR comment, but I don't think the new service needs an ID,
database.update. I feel like I hardly ever see service IDs being added anymore, but checked recent commits tocore.services.ymland apparently it does happen. Those may be instances where a class is associated with more than one service - I didn't check. I don't have an opinion about it. It just struck me as being unusual. I also noted that the MR inconsistently gets the service from the container by both its ID and class name. Again, it isn't really a problem, so I'm not going to insist on changes. I just wouldn't do it if I were authoring the changes.Comment #20
mradcliffeThanks for the review, @dcam. I applied your suggestions to the MR.
I was reviewing the use of ClassResolver via
\Drupal::classResolver(), and it suggests being used for procedural code only, which I haven't done. I think update.inc should use that rather than ::service, but should any non-static functions also use that? It seems to only be used in Hooks and not even tests. I think we should probably stick with\Drupal::service()and the id for now.Comment #21
kim.pepperClassResolveris useful to instantiate classes that aren't services.Comment #22
nicxvan commentedMade a bunch of comments before remembering @dcam already covered some of them here sorry.
We can avoid all of the class resolver stuff I think with my other comments and suggestions see https://www.drupal.org/node/3570904
Please let me know if you have any questions!
I also commented on the pt 3, I think we do this in two issues let's see if we can add another function or two here so this and the next issue handle update.inc 50 - 50.
Thanks for taking this on!
Edit: I think there is some confusion here about using classresolver vs service.
In the deprecated functions in all cases you should use ::service we don't need the factory or a static callback for the batch.
The batch callback method does need to be public, please ping me in slack if you need any clarification!
Comment #23
kim.pepperNR for the 3 remaining open comments.
Comment #24
mradcliffeThank you for the review and clarification, @nicxvan and @kimpepper. I understand. The newish CallbableResolver handles the previous issue of serializing the entire class in batch.
Updated issue summary to remove update_set_schema that was removed in #3210931: Remove deprecated update.inc functions.
Comment #25
nicxvan commentedThanks guys, I resolved the two open comments on the MR since they weren't blocking just general comments I noticed.
Also I took a closer look, I think I'm going to retract my request to add another function here to even it out so we can do it in two issues.
This issue does 4 functions, there are 7 remaining functions, two of them are one line functions leaving 5 substantial functions. They have some complexity but I think we can fit them in the final issue.
I'll try to finish my review of this.
Comment #26
nicxvan commentedI think the CR needs an update.
Also added a few more suggestions for the deprecation messages and comments.
I think this is ready once these are applied and the CR is updated.
Comment #27
kim.pepperUpdated the CR
Comment #28
mradcliffeI applied the comment suggestions via GitLab, but left the deprecation message suggestions for further discussion.
Comment #29
mradcliffeBased on discussion in Slack, I updated the change record to have multiple tables for a table per issue with a jump menu. I am not sure what the issue split is going to be so I kept the functions divided at the current open issues (4 tables). And then added a code example section.
Comment #30
nicxvan commentedCR looks much better thanks guys!
The failure looks random
Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderUiTest
This looks great now, it's a pretty straightforward move over, the location and namespace looks right.
Comment #31
mradcliffeRenaming this so it's not as confusing what "pt2" means.
Comment #32
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #33
mradcliffeRebased after #3303751: Reduce the number of times UpdateRegistry scans for extensions, back to RTBC.
Comment #34
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #35
mradcliffeI rebased to incorporate #3561302: Register equivalent updates on site install that was added to core yesterday. Setting to Needs review for someone to review that those changes made it correctly into the DatabaseUpdate before setting back to RTBC.
Comment #36
dcam commentedI checked the change ported from #3561302: Register equivalent updates on site install and it was copied correctly. Thank you for doing the rebase.
Comment #37
amateescu commentedReviewed and proposed a few code change on the MR. They're all mostly minor, so feel free to self-RTBC after reviewing/applying them.
Comment #38
mradcliffeI re-reviewed my rebase + fixes to update.inc to DatabaseUpdate to check if there were any other issues. Setting this back to RTBC based on #37.
Comment #41
amateescu commentedCommitted and pushed 5ac5b9c39bd to main and 0db31a323b1 to 11.x. Thanks!