Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Describe your bug or feature request.
Current code in TaxTypeForm
assumes that custom tax type is always present. However, it can be removed or modified in hook_commerce_tax_type_info_alter()
.
Also the label is hardcoded to "Custom", so in case it is modified, it still appears as "Custom" in the form.
If a bug, provide steps to reproduce it from a clean install.
Plugin requirement:
- Implement hook_commerce_tax_type_info_alter() in a custom module.
- Visit /admin/commerce/config/tax-types/add
- Exception is thrown
function hook_commerce_tax_type_info_alter(&$definitions): void {
unset($definitions['custom']);
}
Plugin label hardcoded:
- Implement hook_commerce_tax_type_info_alter() in a custom module.
- Visit /admin/commerce/config/tax-types/add
- 'Custom' is shown as label instead of 'My New Label'
function hook_commerce_tax_type_info_alter(&$definitions): void {
$definitions['custom']['label'] = 'My New Label';
}
Issue fork commerce-3294242
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
Comment #3
plopescMR created, trying to tackle the 2 issues mentioned above.
It also extracts the logic to generate the list of plugins to its specific method to improve the DX in case of willing to customize the list behavior.
Thank you!
Comment #4
plopescComment #6
jsacksick CreditAttribution: jsacksick at Centarro commentedRenamed the method and committed, thanks!