Skip to content

Commit

Permalink
Merge pull request #3326 from bertoost/feature/entry-author-id
Browse files Browse the repository at this point in the history
Allow Entry authorId being set from the query url parameters
  • Loading branch information
brandonkelly authored Sep 29, 2018
2 parents db3b664 + 39fb22f commit ffb447b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/controllers/EntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -812,9 +812,11 @@ private function _prepEditEntryVariables(array &$variables)
throw new NotFoundHttpException('Entry not found');
}
} else {
$authorId = Craft::$app->getRequest()->getQueryParam('authorId', Craft::$app->getUser()->getIdentity()->id);

$variables['entry'] = new Entry();
$variables['entry']->sectionId = $variables['section']->id;
$variables['entry']->authorId = Craft::$app->getUser()->getIdentity()->id;
$variables['entry']->authorId = $authorId;
$variables['entry']->enabled = true;
$variables['entry']->siteId = $site->id;

Expand Down

0 comments on commit ffb447b

Please sign in to comment.