From e97c135de8f9563b5fa8e7d8973ca09f298f0fd1 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 9 Jun 2021 21:25:22 +0200 Subject: [PATCH] issue #269: Undefined index: revision (#284) Fix an undefined index notice/warning when calling the DocumentHandler::put function with a `revision` option set. --- lib/ArangoDBClient/DocumentHandler.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ArangoDBClient/DocumentHandler.php b/lib/ArangoDBClient/DocumentHandler.php index 948dc512..2024e269 100644 --- a/lib/ArangoDBClient/DocumentHandler.php +++ b/lib/ArangoDBClient/DocumentHandler.php @@ -757,9 +757,10 @@ protected function put($url, $collection, $documentId, Document $document, array if (isset($params[ConnectionOptions::OPTION_REPLACE_POLICY]) && $params[ConnectionOptions::OPTION_REPLACE_POLICY] === UpdatePolicy::ERROR ) { - if (null !== $options['revision']) { + $revision = $document->getRevision(); + if (null !== $revision) { $params['ignoreRevs'] = false; - $headers['if-match'] = '"' . $options['revision'] . '"'; + $headers['if-match'] = '"' . $revision . '"'; } }