Fix URL matching, role filtering, add is_front on authenticated front page

Two issues addressed in AuthenticatedFrontpageSubscriber.php:

  1. URL/path matching:
  • page detection was nested inside the anonymous user check but is now evaluated unconditionally to make it available for use elsewhere in the file
  • for node-based configuration, the node ID is read from $request->attributes->get('_raw_variables'); path configuration handling unchanged
  1. role filtering: field_roles stores unselected roles as ['rolename' => 0], so !empty($roles) was always true, silently breaking the "no roles selected = apply to all authenticated users" behaviour. The fix filters to explicitly selected roles only meaning !empty($roles) can now be false.
  2. is_front Twig variable: when this module redirects authenticated users to a custom front page, is_front remained false on that page. A request attribute now flags the page as the authenticated front, and hook_preprocess_page() sets is_front accordingly.

Merge request reports

Loading
Loading