From f029bfcc61f4cc7680c5456fe6199358c73b2843 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Thu, 28 Apr 2016 18:05:19 +1200 Subject: [PATCH] Partial revert of #458 Fix travis configuration --- .travis.yml | 26 +++++-------------- .../editableformfields/EditableFileField.php | 10 +++---- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4b005c7..6367e79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,24 +4,20 @@ sudo: false language: php -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - -env: - - DB=MYSQL CORE_RELEASE=3.1 - matrix: include: + - php: 5.3 + env: DB=MYSQL CORE_RELEASE=3.1 + - php: 5.4 + env: DB=MYSQL CORE_RELEASE=3.2 + - php: 5.5 + env: DB=MYSQL CORE_RELEASE=3.3 - php: 5.6 env: DB=MYSQL CORE_RELEASE=3 - php: 5.6 env: DB=MYSQL CORE_RELEASE=3.1 SECUREASSETS=1 - php: 5.6 - env: DB=PGSQL CORE_RELEASE=3.1 + env: DB=PGSQL CORE_RELEASE=3.3 before_script: - git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support @@ -35,11 +31,3 @@ script: - git remote rm origin - git remote add origin git@github.com:silverstripe/silverstripe-userforms.git - php ocular.phar code-coverage:upload --format=php-clover coverage.clover - -branches: - only: - - master - -matrix: - allow_failures: - - php: 7.0 diff --git a/code/model/editableformfields/EditableFileField.php b/code/model/editableformfields/EditableFileField.php index 2fe8954..37fa70d 100755 --- a/code/model/editableformfields/EditableFileField.php +++ b/code/model/editableformfields/EditableFileField.php @@ -49,12 +49,10 @@ class EditableFileField extends EditableFormField { } public function getFormField() { - if(isset(Config::inst()->get('EditableFileField', 'use_uploadfield')) && Config::inst()->get('EditableFileField', 'use_uploadfield')) { - $field = Upload::create($this->Name, $this->EscapedTitle); - } else { - $field = FileField::create($this->Name, $this->EscapedTitle); - } - + $field = FileField::create($this->Name, $this->EscapedTitle) + ->setFieldHolderTemplate('UserFormsField_holder') + ->setTemplate('UserFormsFileField'); + $field->setFieldHolderTemplate('UserFormsField_holder') ->setTemplate('UserFormsFileField');