Skip to content

Commit 827e99d

Browse files
committed
issue #269: Undefined index: revision
Fix an undefined index notice/warning when calling the DocumentHandler::put function with a `revision` option set.
1 parent 9f061fd commit 827e99d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ArangoDBClient/DocumentHandler.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,10 @@ protected function put($url, $collection, $documentId, Document $document, array
757757
if (isset($params[ConnectionOptions::OPTION_REPLACE_POLICY]) &&
758758
$params[ConnectionOptions::OPTION_REPLACE_POLICY] === UpdatePolicy::ERROR
759759
) {
760-
if (null !== $options['revision']) {
760+
$revision = $document->getRevision();
761+
if (null !== $revision) {
761762
$params['ignoreRevs'] = false;
762-
$headers['if-match'] = '"' . $options['revision'] . '"';
763+
$headers['if-match'] = '"' . $revision . '"';
763764
}
764765
}
765766

0 commit comments

Comments
 (0)