Problem/Motivation

The root cause is a mismatch between the permission machine name defined in meaofd.permissions.yml and the string used in the hasPermission() check inside MismatchedEntityAndOrFieldDefinitionsReportController::report().
- Defined in meaofd.permissions.yml: fix mismatched entity and or field definitions
- Checked in the controller: fix mismatched entity and/or field definitions (contains a forward slash)
Because these strings do not match, hasPermission() always returns false, and the code always falls into the else branch which renders a disabled, non-clickable button instead of a working link.

Steps to reproduce

1. Install the meaofd module.
2. Go to Admin > People > Permissions and grant the Fix mismatched entity and/or field definitions permission to a role (e.g. Administrator).
3. Log in as a user with that role.
4. Navigate to /admin/reports/mismatched-entity-and-or-field-definitions.
5. If any mismatches are listed, observe that the Fix button is disabled and not clickable, despite the user having the correct permission.

Proposed resolution

Fix the permission string in MismatchedEntityAndOrFieldDefinitionsReportController::report() to match the machine name defined in meaofd.permissions.yml by removing the forward slash from and/or.
src/Controller/MismatchedEntityAndOrFieldDefinitionsReportController.php
- $is_fix_allowed = $this->currentUser()->hasPermission('fix mismatched entity and/or field definitions');
+ $is_fix_allowed = $this->currentUser()->hasPermission('fix mismatched entity and or field definitions');

Comments

yogeshsevak created an issue. See original summary.

yogeshsevak’s picture

Assigned: yogeshsevak » Unassigned
Status: Active » Needs review
StatusFileSize
new606 bytes

Providing patch for the fixes.