How-To Article Issues - How to create alert notifications and modals

After reading the wealth of very helpful information at:

I started to use ConcreteAlert in v8.5.7 and it works just fine when when I am logged in as a superuser or an administrator but when I am logged in as a normal user it does not work and the browser console returns:

Uncaught ReferenceError: ConcreteAlert is not defined
at Object.success (user-login-data:1300:33)
at i (jquery.js?ccm_nocache=1a72ca0f3692b16db9673a9a89faff0649086c52:2:27449)
at Object.fireWith [as resolveWith] (jquery.js?ccm_nocache=1a72ca0f3692b16db9673a9a89faff0649086c52:2:28213)
at y (jquery.js?ccm_nocache=1a72ca0f3692b16db9673a9a89faff0649086c52:4:22835)
at XMLHttpRequest.c (jquery.js?ccm_nocache=1a72ca0f3692b16db9673a9a89faff0649086c52:4:26993)

I have tried it on multiple browsers with the same result - no pop-up modal when not an Administrator. Any thoughts on how to fix this?

I wonder if it’s due to jquery/ui not being loaded. Haven’t tested this, but $this->requireAsset(‘jquery/ui’); might be what you’re looking for…

1 Like

ConcreteAlert is used by the core to display messages when editing the website so it’s only loaded when logged in.

If you want to use it on the frontend for general usage, you have to load it yourself as suggested by @enlil

1 Like