Multitab workflow - an option to toggle redirects in add/edit forms to collection/canonical

Created on 29 September 2024, about 2 months ago

From a dev/admin/editor multitab workflow perspective, redirects can be a pain when adding or repeatedly saving something while also checking the outcome in separate tabs.

Attached is a patch that introduces a config form at /admin/commerce/config/settings with an option to toggle the new OFF (default) or ON, which will enable or disable the redirects towards the collection or canonical URL from the add/edit forms of the majority of the Commerce entity forms.

To make this work, circumventing Drupal core's use of the destination query parameter is also needed, so path processors have been added to each Commerce module to toggle it from the query string of their respective relevant outbound paths, depending on the newly introduced setting.

Redirects that can now be toggled towards edit-form with Multitab Workflow:

  • CheckoutFlowForm - instead of collection
  • NumberPatternForm - instead of collection
  • OrderTypeForm - instead of collection
  • OrderItemTypeForm - instead of collection
  • PaymentGatewayForm - instead of collection
  • CurrencyForm - instead of collection
  • ProductAttributeForm - instead of collection, if the entity is NOT new
  • ProductTypeForm - instead of collection
  • ProductForm - instead of canonical, when selecting "Save" as opposed to "Save and add variations"
  • ProductVariationTypeForm - instead of collection
  • ProductVariationForm - instead of collection for the parent Product
  • PromotionForm - instead of collection, when selecting "Save" as opposed to "Save and add coupons"
  • CouponForm - instead of collection for the parent Promotion
  • StoreTypeForm - instead of collection
  • StoreForm - instead of collection
  • TaxTypeForm - instead of collection

The other existing redirects are left as persistent, most notably:

  • OrderForm - towards canonical
  • ProductForm - towards ProductVariation's collection for this Product, when selecting "Save and add variations"
  • PromotionForm - towards PromotionCoupon's collection for this Promotion, when selecting "Save and add coupons"

One redirect has been changed but also remains persistent:

  • OrderUnlockForm - from collection to canonical, to match the other Order forms
Feature request
Status

Needs review

Version

2.0

Component

Developer experience

Created by

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

Comments & Activities

Production build 0.71.5 2024