From 051713a7b7a31a61a4ac1656e827b3f831d8b2d0 Mon Sep 17 00:00:00 2001 From: Ben Claar Date: Thu, 12 Feb 2015 16:14:34 -0600 Subject: [PATCH 1/5] Fix help text for push_checkboxes --- src/Former/Traits/Checkable.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Former/Traits/Checkable.php b/src/Former/Traits/Checkable.php index 9d1d11b1..98b8a8a6 100644 --- a/src/Former/Traits/Checkable.php +++ b/src/Former/Traits/Checkable.php @@ -368,6 +368,10 @@ protected function createCheckable($item, $fallbackValue = 1) if ($this->isOfType('checkbox', 'checkboxes')) { if ($this->isPushed or ($this->app['former']->getOption('push_checkboxes') and $this->isPushed !== false)) { $field = $this->app['former']->hidden($name)->forceValue($this->app['former']->getOption('unchecked_value')).$field->render(); + + // app['former.field'] was overwritten by Former::hidden() call in the line above, so here + // we reset it to $this to enable $this->app['former']->getErrors() to retrieve the correct object + $this->app->instance('former.field', $this); } } From dd50a76a62c3416ce785daee6c083e91fbdc1418 Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Tue, 17 Feb 2015 15:18:49 +0100 Subject: [PATCH 2/5] Update mime types to fix the 'accept' attribute of Former::file() field v2 Fix RTF (*.rtf) and PowerPoint (*.ppt) mimes type. Add PowerPoint (*.pps, *.ppsx, *.pptx) and OpenOffice (*.odp, *.ods, *.odt) mimes type. Otherwise they aren't listed in the input file dialog. --- src/Laravel/File.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Laravel/File.php b/src/Laravel/File.php index dce59d3f..6a4769f8 100644 --- a/src/Laravel/File.php +++ b/src/Laravel/File.php @@ -56,6 +56,9 @@ class File 'mpg' => 'video/mpeg', 'mpga' => 'audio/mpeg', 'oda' => 'application/oda', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', 'pdf' => array('application/pdf', 'application/x-download'), 'php' => array('application/x-httpd-php', 'text/x-php'), 'php3' => 'application/x-httpd-php', @@ -63,7 +66,10 @@ class File 'phps' => 'application/x-httpd-php-source', 'phtml' => 'application/x-httpd-php', 'png' => 'image/png', - 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'), + 'pps' => array('application/mspowerpoint', 'application/vnd.ms-powerpoint'), + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'ppt' => array('application/vnd.ms-powerpoint', 'application/powerpoint'), + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'ps' => 'application/postscript', 'psd' => 'application/x-photoshop', 'qt' => 'video/quicktime', @@ -71,7 +77,7 @@ class File 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', - 'rtf' => 'text/rtf', + 'rtf' => array('application/rtf', 'text/rtf'), 'rtx' => 'text/richtext', 'rv' => 'video/vnd.rn-realvideo', 'sea' => 'application/octet-stream', From 0215a7f2bd7689dc47057f32bcb2991683f5255f Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Wed, 18 Feb 2015 10:51:30 +0100 Subject: [PATCH 3/5] Fix tests because the HTMLObject 1.4.1 dependency breaks them. --- tests/Fields/CheckboxTest.php | 2 +- tests/Fields/PlainTextTest.php | 2 +- tests/Fields/RadioTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Fields/CheckboxTest.php b/tests/Fields/CheckboxTest.php index 27e28d41..81eee5e1 100644 --- a/tests/Fields/CheckboxTest.php +++ b/tests/Fields/CheckboxTest.php @@ -59,7 +59,7 @@ private function matchCheckbox( $radio = 'attributes($checkAttr).'>'; if (!$inline && $this->former->framework() === 'TwitterBootstrap3') { - unset($labelAttr['class']); + $labelAttr['class'] = ""; } $control = $label ? 'attributes($labelAttr).'>'.$radio.$label.'' : $radio; diff --git a/tests/Fields/PlainTextTest.php b/tests/Fields/PlainTextTest.php index 2943008c..18b3a4c8 100644 --- a/tests/Fields/PlainTextTest.php +++ b/tests/Fields/PlainTextTest.php @@ -85,7 +85,7 @@ public function matchPlainTextInput() */ protected function formStaticGroup( $input = '
bar
', - $label = '' + $label = '' ) { return $this->formGroup($input, $label); } diff --git a/tests/Fields/RadioTest.php b/tests/Fields/RadioTest.php index 8b058764..6412d786 100644 --- a/tests/Fields/RadioTest.php +++ b/tests/Fields/RadioTest.php @@ -58,7 +58,7 @@ private function matchRadio( $radio = 'attributes($radioAttr).'>'; if (!$inline && $this->former->framework() === 'TwitterBootstrap3') { - unset($labelAttr['class']); + $labelAttr['class'] = ""; } $control = $label ? 'attributes($labelAttr).'>'.$radio.$label.'' : $radio; From c7c89754f78e2c65ad617537a29c040479f8ef7e Mon Sep 17 00:00:00 2001 From: Ben Claar Date: Fri, 27 Feb 2015 10:36:09 -0600 Subject: [PATCH 4/5] Silence deprecated ->assetTag() PHPUnit error --- composer.json | 2 +- tests/TestCases/FormerTests.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a561de8a..0274739e 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "illuminate/translation": "~4.2" }, "require-dev": { - "phpunit/phpunit": "~4.1.6", + "phpunit/phpunit": "~4", "mockery/mockery": "~0.9.1", "illuminate/database": "~4.2" }, diff --git a/tests/TestCases/FormerTests.php b/tests/TestCases/FormerTests.php index 1e69131b..b939be5b 100644 --- a/tests/TestCases/FormerTests.php +++ b/tests/TestCases/FormerTests.php @@ -316,7 +316,8 @@ protected function controlGroupRequired($input, $label = '