Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295813

Exceptions in batch no longer are shown on the page

$
0
0

Problem/Motivation

Discovered while working on #3253158: [PP-1] Add Alpha level Experimental Automatic Updates module. We have functional tests for our updates via the form that use the batch system. We test that if there are exception in the process they are shown.

This works on 10.1.x but does not work on 11.x

I have written a simple test for this and confirmed the behavior has changed from 10.1.x to 11.x

I have looked through core test and I don't there is existing test coverage

When testing this manually with a browser that has javascript enable(unlike the functional test).
There is javascript error

Uncaught TypeError: Cannot read properties of null (reading 'removeAttribute')
at Drupal.Message.defaultWrapper (message.js?v=11.0-dev:43:17)
at new Drupal.Message (message.js?v=11.0-dev:26:46)
at new Drupal.AjaxError (ajax.js?v=11.0-dev:184:35)
at Object.error (progress.js?v=11.0-dev:157:25)
at c (jquery.min.js?v=3.7.0:2:25266)
at Object.fireWith [as rejectWith] (jquery.min.js?v=3.7.0:2:26015)
at l (jquery.min.js?v=3.7.0:2:77746)
at XMLHttpRequest. (jquery.min.js?v=3.7.0:2:80204)

Here is the lines

wrapper = document.querySelector('[data-drupal-messages-fallback]');
        wrapper.removeAttribute('data-drupal-messages-fallback');
        wrapper.setAttribute('data-drupal-messages', '');
        wrapper.classList.remove('hidden');

so it appears document.querySelector('[data-drupal-messages-fallback]'); does not return a result.
This happens in both 11.x and 10.1.x

Steps to reproduce

  1. Enabled the test module batch_test
  2. Goto batch-test
  3. Select "batch 8" and then submit

When testing this manually with a browser that has javascript enabled(unlike the functional test).
There is javascript error

Uncaught TypeError: Cannot read properties of null (reading 'removeAttribute')
at Drupal.Message.defaultWrapper (message.js?v=11.0-dev:43:17)
at new Drupal.Message (message.js?v=11.0-dev:26:46)
at new Drupal.AjaxError (ajax.js?v=11.0-dev:184:35)
at Object.error (progress.js?v=11.0-dev:157:25)
at c (jquery.min.js?v=3.7.0:2:25266)
at Object.fireWith [as rejectWith] (jquery.min.js?v=3.7.0:2:26015)
at l (jquery.min.js?v=3.7.0:2:77746)
at XMLHttpRequest. (jquery.min.js?v=3.7.0:2:80204)

Here is the lines

wrapper = document.querySelector('[data-drupal-messages-fallback]');
        wrapper.removeAttribute('data-drupal-messages-fallback');
        wrapper.setAttribute('data-drupal-messages', '');
        wrapper.classList.remove('hidden');

so it appears document.querySelector('[data-drupal-messages-fallback]'); does not return a result.
This happens in both 11.x and 10.1.x

When testing with Javascript disabled
on 11.x it appears to briefly so the progress and then a white screen

on 10.x the error like and messages appears

Proposed resolution

Add test coverage and fix

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 295813

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>