Skip to content

Commit e97c135

Browse files
authored
issue #269: Undefined index: revision (#284)
Fix an undefined index notice/warning when calling the DocumentHandler::put function with a `revision` option set.
1 parent cbd2e44 commit e97c135

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ArangoDBClient/DocumentHandler.php

+3-2
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)