-
Notifications
You must be signed in to change notification settings - Fork 80
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
Changed order of handle-route (update before create) #99
Conversation
922d268
to
1b1167e
Compare
$article->setAuthorId($author->getId()); | ||
} | ||
if ($document->getAuthor() && $author = $this->contactRepository->findById($document->getAuthor())) { | ||
$article->setAuthorFullName($author->getFullName()); |
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.
@wachterjohannes Why you are not setting the author id anymore?
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.
i have only written it in another format - to make it more readable.
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.
You have changed the function...
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.
Following line is missing:
$article->setAuthorId($author->getId());
$article->setChangerContactId($changer->getContact()->getId()); | ||
} | ||
if ($document->getChanger() && $changer = $this->userManager->getUserById($document->getChanger())) { | ||
$article->setChangerFullName($changer->getFullName()); |
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.
same here
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.
same here (:
$article->setCreatorContactId($creator->getContact()->getId()); | ||
} | ||
if ($document->getCreator() && $creator = $this->userManager->getUserById($document->getCreator())) { | ||
$article->setCreatorFullName($creator->getFullName()); |
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.
same here
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.
same here (:
1b1167e
to
9f23a33
Compare
@trickreich fixed. |
@@ -102,7 +102,7 @@ public static function getSubscribedEvents() | |||
{ | |||
return [ | |||
Events::HYDRATE => [['handleHydrate', -500]], | |||
Events::PERSIST => [['handleRoute', 0], ['handleRouteUpdate', 0], ['handleScheduleIndex', -500]], | |||
Events::PERSIST => [['handleRouteUpdate', 1], ['handleRoute', 0], ['handleScheduleIndex', -500]], |
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.
I thought we make here bigger steps..
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.
it is here important that this is near to each other and in the right order. if you use a bigger priority you have no route - if you use a smaller you have one.
@@ -277,7 +277,10 @@ define([ | |||
}, | |||
|
|||
deleteItems: function(ids) { | |||
this.sandbox.util.save('/admin/api/articles?ids=' + ids.join(','), 'DELETE').then(function() { | |||
this.sandbox.util.save( |
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.
We should use here the ArticleManager
9f23a33
to
084b4d6
Compare
@trickreich fixed |
ack |
What's in this PR?
The order of update and create route is important if you want to create an article with an existing route.
Additional changes:
route_path
to create