From e42bb376f80bda7ae173fe782392e4408b6f4bcc Mon Sep 17 00:00:00 2001 From: Jean-Yves Gaulier Date: Thu, 27 Oct 2016 18:32:39 +0200 Subject: [PATCH] PHRAS-508_acl-cache - fix ref on pdo stmt --- .../Elastic/Indexer/RecordIndex.php | 2 +- lib/classes/ACL.php | 5 +++-- .../Fixtures/configuration-setup.yml | 1 + .../Configuration/Fixtures/configuration.yml | 1 + tests/files/cestlafete.jpg | Bin 31486 -> 31487 bytes 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/RecordIndex.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/RecordIndex.php index 321b19f951..e2af26a5ac 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/RecordIndex.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/RecordIndex.php @@ -118,7 +118,7 @@ class RecordIndex implements MappingProvider $child->setAnalyzer('keyword', 'searching'); $child->addChild((new Mapping\StringFieldMapping('raw'))->enableRawIndexing()); - $thesaurusMapping->addChild($thesaurusMapping); + $thesaurusMapping->addChild($child); } return $thesaurusMapping; diff --git a/lib/classes/ACL.php b/lib/classes/ACL.php index f220183589..5c51cbee2f 100644 --- a/lib/classes/ACL.php +++ b/lib/classes/ACL.php @@ -1152,8 +1152,9 @@ class ACL implements cache_cacheableInterface return $this; } - private function try_give_access_to_base_insert(&$stmt, $base_id, $usr_id) + private function try_give_access_to_base_insert(PDOStatement $stmt, $base_id, $usr_id) { + $stmt = null; $inserted = false; try { $stmt->execute([':base_id' => $base_id, ':usr_id' => $usr_id]); @@ -1169,7 +1170,7 @@ class ACL implements cache_cacheableInterface return $inserted; } - private function try_give_access_to_base_update(&$stmt, $base_id, $usr_id) + private function try_give_access_to_base_update(PDOStatement $stmt, $base_id, $usr_id) { $stmt->execute([':base_id' => $base_id, ':usr_id' => $usr_id]); $stmt->closeCursor(); diff --git a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml index 3a312ed3bb..27eb933247 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml +++ b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml @@ -5,6 +5,7 @@ languages: main: maintenance: false key: '' + api_require_ssl: true database: host: 'sql-host' port: 3306 diff --git a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml index 3a312ed3bb..27eb933247 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml +++ b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml @@ -5,6 +5,7 @@ languages: main: maintenance: false key: '' + api_require_ssl: true database: host: 'sql-host' port: 3306 diff --git a/tests/files/cestlafete.jpg b/tests/files/cestlafete.jpg index 7829881e396c2a8862683d4894933fffaddb56e2..698ec817b02d162ef301cc2c87de508aa5208a58 100755 GIT binary patch delta 26 icmezOmGS>q#tn{)jE0k)7$>kA8t56AZ@$K;Q3(K+K?#}w delta 25 hcmezWmGR$K#tn{)j0TgP7$>k;>X{pCzRsvo2>^~H32^`b