I've a custom callback with a form which works well in last chrome and last FF.

$form['foo']['bar'] = array(
  '#type' => 'submit',
  '#value' => t(''),
  '#attributes' => ['class' => array('search-api glyphicon glyphicon-refresh btn-primary')],
  '#ajax' => [
    'callback' => '::fetchApiData',
    'event' => 'click',
    'effect' => 'none',
    'progress' => [
      'type' => 'throbber',
      'message' => NULL,

However, my customer has a old version of firefox, the esr 45.9.0 version, and when we click on the button that trigger the callback, we have an alert error.

An error occurred while attempting to process /declaration?ajax_form=1&_wrapper_format=drupal_ajax: invalid regular expression flag a

Does anybody know how to debug this?

1 Answer 1


This issue is related to drupal/boostrap theme. It doesn't occur with default drupal theme.

Replace methods in Attributes.cleanClass pass the identifier as a 3rd parameter isn't needed because string replacements in JS are chained. https://www.drupal.org/project/bootstrap/issues/2969106

  • Hello,thank you for your answer, i was about to comment the same thing. Work perfectly without this theme and also with the patch which is linked. Regards,
    – lchabrand
    May 24, 2018 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.