UI Action on Database View Fails for User (401 Unauthorized + GlideModal Null Errors)

MarLoi
Tera Contributor

We have created a custom list UI action that appears on a database view.

It calls a client-callable script include, and also uses the following modals.
- GlideModal: glide_confirm_basic, glide_warn

 

var confirm = new GlideModal('glide_confirm_basic', true, 500);
    confirm.setTitle(getMessage('Confirmation'));
    confirm.setPreference('title', '<p>' + getMessage('Do you wish to proceed?') + '</p><br/>');
    confirm.setPreference('focusTrap', true);
    confirm.setPreference('onPromptComplete', handleFunction);
    confirm.setPreference("onPromptCancel", function() {
		return false;
	});
    confirm.render();
var result = new GlideModal('glide_warn', true, 500);
		result.setTitle(getMessage('Process Results'));
		result.setPreference('title', '<p>' + message + '</p><br/>');
		result.setPreference('onPromptComplete', function() {
			return false;
		});
		result.render();

 

- GlideDialogWindow: dialog_loading

var load = new GlideDialogWindow("dialog_loading", true);
    load.setPreference('table', 'loading');
    load.setTitle(getMessage('Loading...'));
    load.render();


The UI action has the condition: gs.hasRole('admin').
Only the client-callable script include has an ACL; with the role ‘admin’.

But for some reason, when another admin user (with the same roles as ours) clicks the UI action button, the following happens:

  • No modal popup
  • “Uncaught TypeError: Cannot read properties of null (reading ‘getElementsByTagName’) at GlideModal._renderFromAjax, at klass._responseReceived, at klass._processReqChange” error logged in console
  • “POST [instance link] 401 (Unauthorized)” errors logged in console
  • “Cannot invoke "com.glide.ui.portal.AbstractRenderer.setPreferences(java.util.HashMap)" because "this.fRenderer" is null: java.lang.NullPointerException” error in system logs


We have tried impersonating this user and the UI action performs as expected with no errors logged. We have also tried testing the UI action using different browsers (Chrome, Mozilla, Edge).


Any suggestions in how to find the cause or resolve this confusing issue will be very much appreciated.
Thanks!

0 REPLIES 0