Skip to content

Commit

Permalink
Auto populate collection when coming from entry view
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-cz committed Sep 9, 2016
1 parent 529096e commit e983efc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Controller/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ protected function getSelectedCollection($docs)
return null;
}

// Compare referrer without query to generated route for collection entries
foreach ($docs->toArray() as $doc) {
if ($_SERVER['HTTP_REFERER'] == $this->app['site_url'] . $this->app->routeUrl('collections/entries/' . $doc['_id'])) {
if (strstr($_SERVER['HTTP_REFERER'], '?', true) == $this->app['site_url'] . $this->app->routeUrl('collections/entries/' . $doc['_id'])) {
return $doc;
}
}
Expand Down

0 comments on commit e983efc

Please sign in to comment.