You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #7494 Misc changes related to custom CRUD actions (javiereguiluz)
This PR was squashed before being merged into the 4.x branch.
Discussion
----------
Misc changes related to custom CRUD actions
This is closely related to #7493 and backports many of those change to 4.x to smooth the upgrade when using custom CRUD actions.
Commits
-------
3bbf921 Misc changes related to custom CRUD actions
Copy file name to clipboardExpand all lines: src/Attribute/AdminAction.php
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,5 +16,6 @@ public function __construct(
16
16
public ?string$routeName = null,
17
17
publicarray$methods = ['GET'],
18
18
) {
19
+
@trigger_deprecation('easycorp/easyadmin-bundle', '4.29.5', 'The "%s()" attribute is deprecated and will be removed in EasyAdmin 5.1.0. Use the #[AdminRoute] attribute instead.', __METHOD__);
Copy file name to clipboardExpand all lines: src/Attribute/AdminCrud.php
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,5 +12,6 @@ public function __construct(
12
12
public ?string$routePath = null,
13
13
public ?string$routeName = null,
14
14
) {
15
+
@trigger_deprecation('easycorp/easyadmin-bundle', '4.29.5', 'The "%s()" attribute is deprecated and will be removed in EasyAdmin 5.1.0. Use the #[AdminRoute] attribute instead.', __METHOD__);
$reflMethod = new \ReflectionMethod($crudControllerFqcn, $crudActionName);
408
+
if ([] === $reflMethod->getAttributes(AdminRoute::class)) {
409
+
trigger_deprecation(
410
+
'easycorp/easyadmin-bundle',
411
+
'4.29.5',
412
+
'The "%s()" method in "%s" is used as a custom CRUD action (via "linkToCrudAction()") but it is missing the #[AdminRoute] attribute. In EasyAdmin 5.x, you must add the #[AdminRoute] attribute to the "%s()" method to enable it as a CRUD action. See the UPGRADE.md file.',
413
+
$crudActionName,
414
+
$crudControllerFqcn,
415
+
$crudActionName
416
+
);
417
+
}
418
+
} catch (\ReflectionException) {
419
+
// the method doesn't exist; this will be caught elsewhere
420
+
}
421
+
}
422
+
399
423
$requestParameters = [
400
-
// when using pretty URLs, the data is in the request attributes instead of the query string
0 commit comments