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

dianacastillo created an issue. See original summary.

dianacastillo’s picture

I 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()));
}

dianacastillo’s picture

i 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?

  • fc3a1ac committed on 8.x-1.x
    Issue #3133844: getting warning and popup not working
    
gaurav.kapoor’s picture

Status: Active » Needs review

@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?

gaurav.kapoor’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.