Actions must link to either a route, a CRUD action, or a URL. Set the "linkToCrudAction()", "linkToRoute()", or "linkToUrl()" method for the "testAction" action.
Expected result
We should not have error and see the new action in index page.
Analyze and possible fix
When updating an action, we recreate them based on dto information thanks to function getAsConfigObject in class ActionDto.php and then get the dto again based on a the new object created. During this process, url value is lost and we then got an error message.
We could improve function getAsConfigObject in class ActionDto.php by including url in config object with just a few line to add:
if (null !== $this->url) {
$action->linkToUrl($this->url);
}
I tested it briefly and it works but maybe it was intended to not take care or url value ?
Bug description
An action created with only a url link cannot be updated with function
$actions->update
.Steps to reproduce
configureActions
function following code:Observed result
We got following error:
Expected result
We should not have error and see the new action in index page.
Analyze and possible fix
When updating an action, we recreate them based on dto information thanks to function
getAsConfigObject
in classActionDto.php
and then get the dto again based on a the new object created. During this process, url value is lost and we then got an error message.We could improve function
getAsConfigObject
in classActionDto.php
by including url in config object with just a few line to add:I tested it briefly and it works but maybe it was intended to not take care or url value ?