Skip to content

Commit 8a0232f

Browse files
Fix the swapped debug messages of InsufficientEntityPermissionException
The if/else branches were inverted: when the entity ID was present, the message omitted it, and when it was absent, the message interpolated a null ID. Also remove the double space in 'id ='.
1 parent dab940d commit 8a0232f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Exception/InsufficientEntityPermissionException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public function __construct(AdminContext $adminContext)
1818
];
1919

2020
if (null !== $entityId) {
21-
$debugMessage = sprintf('You don\'t have enough permissions to access this instance of the "%s" entity.', $parameters['entity_fqcn']);
21+
$debugMessage = sprintf('You don\'t have enough permissions to access the instance of the "%s" entity with id = %s.', $parameters['entity_fqcn'], $entityId);
2222
} else {
23-
$debugMessage = sprintf('You don\'t have enough permissions to access the instance of the "%s" entity with id = %s.', $parameters['entity_fqcn'], $entityId);
23+
$debugMessage = sprintf('You don\'t have enough permissions to access this instance of the "%s" entity.', $parameters['entity_fqcn']);
2424
}
2525

2626
$exceptionContext = new ExceptionContext(

0 commit comments

Comments
 (0)