-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve tags by name instead of id #6
Conversation
fbf2c12
to
e1c5cfd
Compare
@@ -32,11 +32,11 @@ public function __construct( | |||
|
|||
public function load(array $ids, ?string $locale, array $params = []): array | |||
{ | |||
$result = $this->tagRepository->findBy(['id' => $ids]); | |||
$result = $this->tagRepository->findBy(['name' => $ids]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this migrated correctly by the phpcr migration bundle? Currently tags are stored as ids
in the excerpt in phpcr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't
But tbh I would like it more to save the id
instead of the name
, but then we would need to adjust it also on the FE 🤔
What would be the best way to go forward?
|
||
$mappedResult = []; | ||
foreach ($result as $tag) { | ||
$mappedResult[$tag->getId()] = $tag->getName(); | ||
$mappedResult[$tag->getName()] = $tag->getName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about remove the loader if we just rereturn the names here.
What's in this PR?
Resolve tags by name instead of id.
Why?
Because the react admin always works with the
name
of the tag instead of the id.To Do