trewknowledge / GDPR

This plugin is meant to assist a Controller, Data Processor, and Data Protection Officer (DPO) with efforts to meet the obligations and rights enacted under the GDPR.
https://wordpress.org/plugins/gdpr/
GNU General Public License v2.0
149 stars 44 forks source link

Can't close modals #232

Open Matthieu1987 opened 6 years ago

Matthieu1987 commented 6 years ago

Hello we have problem with some modals. They won't close and trigger error.

https://github.com/trewknowledge/GDPR/blob/e57d58770841447b659272a13c80448829227ece/src/js/public/gdpr-public.js#L96

gdpr-public.js?ver=2.1.0:1 Uncaught TypeError: t[o] is not a function var o = e(this).data("callback"); t[o]() Maybe there are no callback in the element ? However, i just verify if the function exist before trigger it. var o = e(this).data("callback"); if(typeof t[o] === 'function'){ t[o]() }

brianweyer commented 6 years ago

@Matthieu1987 It looks like this is due to data-callback="closeNotification" missing from https://github.com/trewknowledge/GDPR/blob/develop/public/partials/confirmation-screens.php#L58

I just ran into the same problem. It was looking for the data property with the name callback and a function name to call. But since none is provided, it can't find the function to call.

wking-io commented 5 years ago

This is still an issue!