Convert batch redirect to CallbackResolver

Created on 6 August 2025, about 1 month ago

Problem/Motivation

These redirects are required to be in a .module file. Let's allow arbitrary callbacks.

Steps to reproduce

N/A

Proposed resolution

Convert to CallbackResolver

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

forms system

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • Merge request !12921Callable resolver for batch redirects β†’ (Open) created by nicxvan
  • Pipeline finished with Failed
    about 1 month ago
    Total: 188s
    #565746
  • Pipeline finished with Failed
    about 1 month ago
    Total: 559s
    #565765
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    There 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.

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    > 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

  • Pipeline finished with Canceled
    2 days ago
    #589591
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Thanks 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.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • Pipeline finished with Failed
    2 days ago
    #589596
  • Pipeline finished with Failed
    2 days ago
    Total: 758s
    #589601
  • Pipeline finished with Failed
    2 days ago
    Total: 367s
    #589614
  • Pipeline finished with Failed
    1 day ago
    Total: 1570s
    #590534
  • Pipeline finished with Failed
    1 day ago
    Total: 1487s
    #590546
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Some 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.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    (Drupal\Tests\system\Functional\Batch\Processing)
    ✘ Batch form multiple batches
    ✘ Batch form programmatic

  • Pipeline finished with Failed
    about 8 hours ago
    Total: 293s
    #591413
  • Pipeline finished with Failed
    about 8 hours ago
    Total: 821s
    #591416
  • Pipeline finished with Failed
    about 7 hours ago
    #591420
Production build 0.71.5 2024