Closed martixy closed 5 years ago
it doesn't respect a false value
What do you mean by that?
Entity Post with id and name property
If you use ->addIdentifier('name') it links to the Post-Edit, it has nothing todo with referenced entities. You could also add ->addIdentifier('id') AND ->addIdentifier('name'), in this case you could remove the list action for edit to save some space if you want
Right... so this is tied to the addIdentifier method. Which makes me question its existence at all.
What do you mean by that?
->addIdentifier('name')
and
->add('name', null, ['identifier' => false])
(or ['identifier' => '']
for that matter)
are identical - i.e. it doesn't respect the value of the property, it just looks for its presence or absence.
The wording in the documentation I linked is also incredibly poor.
What it implies however is useful and I'd like to put that as a suggestion. That is - remove the identifier option entirely, and introduce a better-named one that controls whether it creates a link to edit the referenced object.
I wasn't even aware this option existed. I guess it is does nothing, we should deprecate it, or make it treat falsy values by not adding a link.
The wording in the documentation I linked is also incredibly poor.
Can you contribute something about that?
That is - remove the identifier option entirely, and introduce a better-named one that controls whether it creates a link to edit the referenced object.
:+1: Great idea! Can you contribute it, but with a deprecation instead of a removal?
I'm new to the "contributing" scene. So don't know... maybe. I don't even know where the documentation lives.
It lives in Resource/doc
, and you can read CONTRIBUTING.md in this repo, contributing to the docs or code is described at length in it.
Sonata packages
PHP version
Subject
I was reading here. Either I am misunderstanding what the identifier property does, it doesn't do what it says it does.
As I understood it, if set to true it will create a link to edit the associated object(if it has an admin). But it always creates a link and it doesn't respect a false value.