Follow-up to kessai #3610757, which makes kessai's PaymentStorageSchema extensible: it drops final and exposes a protected indexes() seam that a consumer overrides to add its own indexes.

orchestra_payment adds the orchestra_token base field to the kessai_payment entity and indexes it with a composite (orchestra_token, kind, state) index. Because kessai's PaymentStorageSchema was final, the bridge could not extend it: it extends SqlContentEntityStorageSchema directly and re-declares kessai's own kessai_payment__subject_kind index alongside its own, so swapping the storage-schema handler never drops the base index. That copy has to be kept in step with kessai by hand, which is exactly the drift risk kessai #3610757 was filed to remove.

Proposed change

  • Change Drupal\orchestra_payment\PaymentStorageSchema to extend Drupal\kessai\PaymentStorageSchema instead of SqlContentEntityStorageSchema.
  • Replace the getEntitySchema() override with an indexes() override that returns parent::indexes() merged with the bridge's (orchestra_token, kind, state) index.
  • Drop the re-declared kessai_payment__subject_kind entry: it now comes from the parent, so there is no copy left to keep in step.
  • Update the class docblock and the PaymentIndexTest wording that mention the "final, cannot extend" workaround. The test assertions stay as they are (both indexes must still exist after the handler swap), so it keeps guarding the behavior.

Dependency

This depends on kessai #3610757 landing first. Once it is in a kessai release, raise orchestra_payment's kessai dependency to that version so the extensible base class is guaranteed to be present.

Issue fork orchestra-3610814

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • mably committed 21796963 on 1.x
    task: #3610814 orchestra_payment: extend kessai's PaymentStorageSchema...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.