From e983efc0128360f535803c28e7e2be641840bf86 Mon Sep 17 00:00:00 2001 From: Piotr Konieczny Date: Fri, 9 Sep 2016 11:23:29 +0200 Subject: [PATCH] Auto populate collection when coming from entry view --- Controller/Import.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Controller/Import.php b/Controller/Import.php index 19c88a4..1017dcc 100644 --- a/Controller/Import.php +++ b/Controller/Import.php @@ -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; } }