SonataDoctrineORMAdminBundle: error with link rendering
after commit ec1949a98c1dddf79533db0b272f9573ad6e63ac I have such problem:
An exception has been thrown during the rendering of a template
("Parameter "id" for route
"ru__RG__admin_topes_website_company_edit"
must match "[^/]++" ("" given) to
generate a corresponding URL.") in
SonataDoctrineORMAdminBundle:CRUD:list_orm_many_to_one.html.twig at line 16.
It occurs when is the relationship between the User and the Company (many-to-one)
and i want to show company field in admin list
$listMapper
->addIdentifier('username')
->add('company', null, array( ) )
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 25 (9 by maintainers)
@mattchete nope š¦
In my case iāve got almost same problem:
My entities:
So when Iām creating Survey, I add one SurveyQuestion, attach image with sonata-media, and then I want to add another one SurveyQuestion, but get this exception.
It is about the Image doesnāt have an id, so method generateObjectUrl(āeditā, value) from SonataMediaBundle:Form:media_widgets.html.twig line 6 crushes.
So I solved this partially with rearranging default template, like it is said in sonata docs.
Iāve just added this to my config.yml:
And my new template has just one more check to render the imageās link and thumb - āand value.idā on lines 4 and 22:
Now there is no exception, but still have problem: non saved images attached to questions disappear after adding new SurveyQuestion.
So itās not a solution, but Iām on my way )