Closed (fixed)
Project:
Exit pop up
Version:
8.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 May 2020 at 15:14 UTC
Updated:
15 Jul 2020 at 12:14 UTC
Jump to comment: Most recent
i get these warnings:
Warning: array_filter() expects parameter 1 to be array, null given in exitpopup_preprocess_page() (line 16 of modules/contrib/exitpopup/exitpopup.module).
Warning: array_intersect(): Expected parameter 1 to be an array, null given in exitpopup_preprocess_page() (line 16 of modules/contrib/exitpopup/exitpopup.module).
and the popup doesnt work
Comments
Comment #2
dianacastillo commentedI got rid of this warning by adding this code in the module
$config = \Drupal::config('exitpopup.settings');
$current_user = User::load(\Drupal::currentUser()->id());
if ($config->get('roles')== NULL){
$checkRole = TRUE;
}else{
$checkRole = !empty(array_intersect(array_filter($config->get('roles')), $current_user->getRoles()));
}
Comment #3
dianacastillo commentedi got rid of the warning and i have the javascript library installed. but no popup. is it possible that this doesnt work because modern browsers dont allow popups?
Comment #5
gaurav.kapoor commented@dianacastillo Thanks for identifying the issue, to suppress the warnings suggested code has been pushed. I am using latest release and the module is working fine for me. Can you confirm if it is working for you?
Comment #6
gaurav.kapoor commented