Submitted by request from UF chat.
Applies to both UF4 and UF5.
If a modal causes an error (e.g. permission denied) then trying to repeat the action, or attempt to do any other action which would trigger a modal, without reloading the page does not do anything. This is because the "renderError.ufModal" event is never listened to and ufModal.destroy() is never called.
I managed to add a recursive global listener (required because the ufModal.destroy() method removes all listeners) by doing something like:
$(document).ready(function() {
const handleModalError = function() {
$(this).ufModal('destroy');
$('body').on('renderError.ufModal', handleModalError);
}
$('body').on('renderError.ufModal', handleModalError);
});
however it causes a javscript exception (uf-modal.js:146):
Uncaught TypeError: instance is undefined
Submitted by request from UF chat.
Applies to both UF4 and UF5.
If a modal causes an error (e.g. permission denied) then trying to repeat the action, or attempt to do any other action which would trigger a modal, without reloading the page does not do anything. This is because the "renderError.ufModal" event is never listened to and
ufModal.destroy()is never called.I managed to add a recursive global listener (required because the
ufModal.destroy()method removes all listeners) by doing something like:however it causes a javscript exception (uf-modal.js:146):