summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-07-09 06:43:55 +0200
committerRemi Collet <remi@remirepo.net>2018-07-09 06:43:55 +0200
commit72c7a4e5f84248fccef9f1a9888ded9c4377a01d (patch)
treee5cc138aa78c5be764ff02997121c3344973eebb
parent3c9d4f49cc105b79fe00bf2af9f75dfee12d6937 (diff)
add upstream for ext-mongodb 1.5
-rw-r--r--233.patch23
-rw-r--r--php-alcaeus-mongo-php-adapter.spec8
2 files changed, 30 insertions, 1 deletions
diff --git a/233.patch b/233.patch
new file mode 100644
index 0000000..04b0869
--- /dev/null
+++ b/233.patch
@@ -0,0 +1,23 @@
+From b2b8c62209ebe051cddeb7b8fd3963b51a81a17e Mon Sep 17 00:00:00 2001
+From: Andreas Braun <git@alcaeus.org>
+Date: Sat, 7 Jul 2018 14:17:24 +0200
+Subject: [PATCH] Fix access to non-existing write results
+
+Fixes #231.
+---
+ lib/Alcaeus/MongoDbAdapter/ExceptionConverter.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Alcaeus/MongoDbAdapter/ExceptionConverter.php b/lib/Alcaeus/MongoDbAdapter/ExceptionConverter.php
+index 8838a69..48b09de 100644
+--- a/lib/Alcaeus/MongoDbAdapter/ExceptionConverter.php
++++ b/lib/Alcaeus/MongoDbAdapter/ExceptionConverter.php
+@@ -45,7 +45,7 @@ public static function toLegacy(Exception\Exception $e, $fallbackClass = 'MongoE
+ case Exception\WriteException::class:
+ $writeResult = $e->getWriteResult();
+
+- if ($writeResult) {
++ if ($writeResult && $writeResult->getWriteErrors() !== []) {
+ $writeError = $writeResult->getWriteErrors()[0];
+
+ $message = $writeError->getMessage();
diff --git a/php-alcaeus-mongo-php-adapter.spec b/php-alcaeus-mongo-php-adapter.spec
index b70b894..8a30633 100644
--- a/php-alcaeus-mongo-php-adapter.spec
+++ b/php-alcaeus-mongo-php-adapter.spec
@@ -22,7 +22,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 1.1.5
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Mongo PHP Adapter
Group: Development/Libraries
@@ -30,6 +30,8 @@ License: MIT
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?prever}-%{?gh_short}.tar.gz
+Patch0: https://patch-diff.githubusercontent.com/raw/alcaeus/mongo-php-adapter/pull/233.patch
+
BuildArch: noarch
BuildRequires: php-fedora-autoloader-devel
BuildRequires: php(language) >= 5.6
@@ -82,6 +84,7 @@ Autoloader: %{_datadir}/php/%{ns_vendor}/MongoDbAdapter/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+%patch0 -p1
mv lib/Mongo lib/%{ns_vendor}/Mongo
@@ -149,6 +152,9 @@ exit $ret
%changelog
+* Mon Jul 9 2018 Remi Collet <remi@remirepo.net> - 1.1.5-2
+- add upstream for ext-mongodb 1.5
+
* Tue Mar 6 2018 Remi Collet <remi@remirepo.net> - 1.1.5-1
- Update to 1.1.5
- switch to phpunit7