Closed (fixed)
Project:
Drupal core
Version:
11.3.x-dev
Component:
forms system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2025 at 03:47 UTC
Updated:
24 Feb 2026 at 21:45 UTC
Jump to comment: Most recent
Comments
Comment #2
nicxvan commentedComment #3
nicxvan commentedComment #5
nicxvan commentedThere was a comment here #3520416-30: [meta] Handle calls to functions that still require .module file autoloading.
I'm still not quite sure what @berdir meant there unless he means this should just call CallableResolver with no try catch so it dies if it fails.
I'm going to set this as needs review in the meantime.
Comment #6
berdir> unless he means this should just call CallableResolver with no try catch so it dies if it fails.
That's exactly what he meant. That's what it should be IMHO. The only question is whether or not we need to worry about BC here. But I don't see a reason why you'd expect to be able to provide a callback here that doesn't actually work.
That said, the reason I pushed for this to be a separate issue is that I think all batch related callbacks should use this. Essentially all call_user_func_array() calls in batch.inc
Comment #7
nicxvan commentedThanks for confirming!
I started with just pulling out this one try catch.
I then did a naive replacement in batch.inc, let's see what tests say.
Comment #8
nicxvan commentedComment #9
nicxvan commentedSome tests are failing there were a few related to the number of arguments splat operator took care of most of them but there are still a couple failures I haven't had a chance to review.
I think it's still the number of args calluserfuncarray handle it differently.
Comment #10
nicxvan commented(Drupal\Tests\system\Functional\Batch\Processing)
✘ Batch form multiple batches
✘ Batch form programmatic
Comment #11
nicxvan commentedThis is ready for review now!
Comment #12
berdirOne comment.
Comment #13
nicxvan commentedI'm not sure how test only is passing, it's a service... maybe the bot set up the test wrong?
Comment #14
berdirLooking at https://git.drupalcode.org/issue/drupal-3539919/-/jobs/6807564, it doesn't seem to run any tests, it also doesn't list the changed tests as changed files, so you might need to set up a separate MR. or we'll just have to verify locally, I'll try doing that when I find some time.
Comment #15
nicxvan commentedI can take care of that!
Edit: https://git.drupalcode.org/issue/drupal-3539919/-/pipelines/621754
Comment #17
nicxvan commentedComment #18
berdirThe code is pretty complex in how the by-reference and callbacks works, but we have some tests I think this looks good.
This enables quite a bit of cleanup and removal and conversion of helper functions, non-injectable static methods and functions in remaining include files.
Comment #19
nicxvan commentedRequested follow ups created.
Comment #21
catchLooks good. Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!
Comment #27
acbramley commentedI'm trying to follow the CR to update #3533299: Deprecate node access rebuild functions to use the callable syntax but I get
when using
Looking at the commits here it doesn't look like we have test coverage for the BatchBuilder approach?
Comment #28
berdirYes we didn't, I think we should remove the callable type there, this is not a language-level type that we can check there. I think that's OK because BatchBuilder isn't something that's meant to be subclassed and even if it is, an existing method definition could still add the type even if the parent doesn't have it since this is not an interface.
Can you create an issue for that?
Comment #29
acbramley commentedSure thing #3575096: Remove callable type from BatchBuilder ::addOperation and ::setFinishCallback
Comment #30
voleger#27: is not proper callable string - replace
:with::.Comment #31
nicxvan commentedSingle
:is valid in this situation: https://git.drupalcode.org/project/drupal/-/blob/main/core/lib/Drupal/Co...I moved the CR back and updated something that referenced form objects.
In general if it's a service I think we use the double
::, if it's not we use the single:.Comment #32
acbramley commentedIsn't it the opposite? Single : for services, double for non services?
Comment #33
nicxvan commentedYou're right, I always confuse the two and I literally read the comment:
// Callable in the service:method notation.and still confused it :DBottom line is it should be valid, but we made a mistake, the follow up should be ready.