The MailjetConfigurationAccessCheck::applies() method incorrectly returns TRUE for all routes, causing the access check to be applied to every page on the site, not just Mailjet administration pages. This results in anonymous users being blocked from accessing any page on the site, even when Mailjet is properly configured.
Error thrown:
Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException: in Drupal\Core\Routing\AccessAwareRouter->checkAccess()
This is a critical bug that makes the entire site inaccessible to anonymous users after installing the Mailjet module.
Expected behavior: Anonymous users should be able to access public pages normally, with Mailjet access checks only applying to Mailjet administration routes.
Modify the applies() method in src/Access/MailjetConfigurationAccessCheck.php to only apply the access check to routes that actually require it:
// Current problematic code:
public function applies(Route $route) {
return TRUE; // Applies to ALL routes
}
// Proposed fix:
public function applies(Route $route) {
return $route->hasRequirement('_mailjet_access_check'); // Only Mailjet admin routes
}
This change ensures that:
None. This is a backend fix that doesn't affect the user interface.
None. This fix doesn't change any public APIs.
None. This fix doesn't modify any data structures or database schema.
Active
4.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.