Skip to content

Commit

Permalink
Add a temporary workaround for #2884870.
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanz committed Jun 9, 2017
1 parent 9897285 commit df37432
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/tax/src/Form/TaxTypeForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function form(array $form, FormStateInterface $form_state) {
'#default_value' => $plugin,
'#required' => TRUE,
'#disabled' => !$type->isNew(),
'#limit_validation_errors' => [],
'#ajax' => [
'callback' => '::ajaxRefresh',
'wrapper' => $wrapper_id,
Expand Down
6 changes: 6 additions & 0 deletions modules/tax/src/Plugin/Commerce/TaxType/Custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ public function removeTerritorySubmit(array $form, FormStateInterface $form_stat
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
if (!isset($form['territories'])) {
// The form was built by a different plugin, and is now in the process
// of being rebuilt. Temporary workaround for #2884870.
return;
}

$values = $form_state->getValue($form['#parents']);
$values['rates'] = array_filter($values['rates'], function ($rate) {
return !empty($rate) && !isset($rate['add_rate']);
Expand Down

0 comments on commit df37432

Please sign in to comment.