How to reproduce

  1. Go on admin/config/search/xmlsitemap/rebuild
  2. Select only Node entity type from multiselect
  3. Click Save configuration

If you're using Commerce it will return a fatal error like:
Error: Call to a member function access() on null in Drupal\commerce_payment\PaymentAccessControlHandler->checkAccess() (line 23 of /var/www/teatro.it/modules/contrib/commerce/modules/payment/src/PaymentAccessControlHandler.php) #0

However, the problem is due to the fact that the choice made in the multiselect is not respected

I think the problem can be easily resolved like:

public function submitForm(array &$form, FormStateInterface $form_state) {
    $userInput = $form_state->getUserInput();
    // Save any changes to the frontpage link.
    $entity_type_ids = $userInput['entity_type_ids'];
    $save_custom = $form_state->getValue('save_custom');
    $batch = xmlsitemap_rebuild_batch($entity_type_ids, $save_custom);
    batch_set($batch);

    $form_state->setRedirect('xmlsitemap.admin_search');
    parent::submitForm($form, $form_state);
  }
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

sedax created an issue. See original summary.

G42’s picture

I can confirm this behavior on 1.0-alpha2. I tested your changes and created a patch.

nplowman’s picture

Patch #2 worked for me. Thanks!

sedax’s picture

Status: Active » Needs review