Account created on 22 July 2017, over 7 years ago
#

Recent comments

Thanks for the example.

For reference, changing how the different forms called the handler fixed the issue:

function user_config_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  // Handler
  $handler = 'custom_user_submit_handler';
  // Login
  if($form_id == 'user_login_form') {
    $form['#submit'][] = $handler;
  }
  // Register
  elseif ($form_id == 'user_register_form') {
    $form['actions']['submit']['#submit'][] = $handler;
  }
}

Thanks @djdevin! The patch fixes an issue when progressing through Book and Quiz objects in a Drupal 10 course outline.

However, there are now some errors when editing a course outline:

  1. After adding an object to the outline, a Drupal.AjaxError occurs. Reloading the page then shows the added object.
  2. When deleting an object from the outline and then clicking 'Save outline', an exception is thrown:
    Call to a member function get() on null
    /src/Storage/CourseObjectFulfillmentStorage.php on line 106
    $ret = $available[$co->get('object_type')->getString()] ?? [];

    ** Note: I was running into this every time an object was deleted from the outline, but now I can't replicate (?).

Production build 0.71.5 2024