summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-10-02 11:44:04 +0200
committerRemi Collet <fedora@famillecollet.com>2013-10-02 11:44:04 +0200
commit11cedad18cf92a21432e6550be7278430e33faa6 (patch)
treebc40ae6530f95e36e7f96149a06ef4c5a0479f78
parent70cee8fe73943ecd3d5144669de58c0828718d60 (diff)
php-ZendFramework2: add patch needed for GLPI
-rw-r--r--php-ZendFramework2-glpi.patch33
-rw-r--r--php-ZendFramework2.spec10
2 files changed, 42 insertions, 1 deletions
diff --git a/php-ZendFramework2-glpi.patch b/php-ZendFramework2-glpi.patch
new file mode 100644
index 0000000..18609ef
--- /dev/null
+++ b/php-ZendFramework2-glpi.patch
@@ -0,0 +1,33 @@
+diff -up Zend/I18n/Translator/Loader/Gettext.php.glpi Zend/I18n/Translator/Loader/Gettext.php
+--- library/Zend/I18n/Translator/Loader/Gettext.php.glpi 2013-10-02 09:41:18.572098028 +0200
++++ library/Zend/I18n/Translator/Loader/Gettext.php 2013-10-02 09:41:56.658244928 +0200
+@@ -126,9 +126,11 @@ class Gettext implements FileLoaderInter
+
+ array_shift($originalString);
+
+- foreach ($originalString as $string) {
+- $textDomain[$string] = '';
+- }
++/// PROBLEM WITH GLPI WHEN singular = plural
++/// opened bug http://framework.zend.com/issues/browse/ZF-11974
++// foreach ($originalString as $string) {
++// $textDomain[$string] = '';
++// }
+ } else {
+ $textDomain[$originalString[0]] = $translationString[0];
+ }
+diff -up Zend/I18n/Translator/Translator.php.glpi Zend/I18n/Translator/Translator.php
+--- library/Zend/I18n/Translator/Translator.php.glpi 2013-10-02 09:32:05.331918805 +0200
++++ library/Zend/I18n/Translator/Translator.php 2013-10-02 09:32:42.679067978 +0200
+@@ -403,6 +403,11 @@ class Translator
+ return ($number == 1 ? $singular : $plural);
+ }
+
++ /// GLPI Hack for languages with 1 plural form (chinese)
++ if (!is_array($translation)) {
++ return $translation;
++ }
++
+ $index = $this->messages[$textDomain][$locale]
+ ->getPluralRule()
+ ->evaluate($number);
diff --git a/php-ZendFramework2.spec b/php-ZendFramework2.spec
index 5e6a1c5..0772a0e 100644
--- a/php-ZendFramework2.spec
+++ b/php-ZendFramework2.spec
@@ -1,6 +1,6 @@
Name: php-ZendFramework2
Version: 2.2.4
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Zend Framework 2
Group: Development/Libraries
@@ -10,6 +10,9 @@ Source0: https://packages.zendframework.com/releases/ZendFramework-%{version}/
#Source1: https://packages.zendframework.com/releases/ZendFramework-%%{version}/ZendFramework-%%{version}-manual-en.tgz
#Source2: https://packages.zendframework.com/releases/ZendFramework-%%{version}/ZendFramework-%%{version}-apidoc.tgz
+# https://bugzilla.redhat.com/1014478 patch needed for GLPI
+Patch0: %{name}-glpi.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -1510,6 +1513,8 @@ and building new XML-RPC servers.
%prep
%setup -q -n ZendFramework-%{version}
+%patch0 -p0
+
%build
# Empty build section, nothing required
@@ -2163,6 +2168,9 @@ ln -s %{name}-common-%{version} %{buildroot}%{_docdir}/%{name}-%{version}
# ##############################################################################
%changelog
+* Wed Oct 2 2013 Remi Collet <remi@fedoraproject.org> 2.2.4-2
+- add patch needed for GLPI #1014478
+
* Sun Sep 29 2013 Remi Collet <remi@fedoraproject.org> 2.2.4-1
- backport 2.2.4 for remi repo