yokai-php / sonata-workflow

Integrate Symfony workflow component in Sonata Admin
MIT License
22 stars 12 forks source link

Exception on "Add new" form #5

Closed jean-gui closed 6 years ago

jean-gui commented 6 years ago

Hi,

I'm trying to use this extension in one of my projects and although it seems to mostly work, when I try to create a new entry from Sonata admin I get the following exception:

An exception has been thrown during the rendering of a template ("Parameter "id" for route "admin_translations_workflow_apply_transition" must match "[^/]++" ("" given) to generate a corresponding URL.").

The route is defined as:

  admin_translations_workflow_apply_transition   ANY        ANY      ANY          /Web/Tools/PressArticles/w3c/accounts/translation/{id}/workflow/transition/{transition}/apply  

I believe the error is due to the fact that the new entry doesn't have an id yet, thus preventing that route from being generated.

Is there something special to do to handle sonata creation forms?

Thanks.

yann-eugone commented 6 years ago

Hello.

Strange thing that I did not encountered this during my tests, but yes, it seems that this is a bug.

Transitions may not be displayed onto new objects pages : will fail in all cases.

I think that fixing #4 will also fix this. Will work on it this evening.

Sorry for the inconvenience.

jean-gui commented 6 years ago

No problem and thanks for replying so quickly!

yann-eugone commented 6 years ago

Released in https://github.com/yokai-php/sonata-workflow/releases/tag/v0.1.2

jean-gui commented 6 years ago

Taht seems to work. Thanks