Merge branch '2.0' into 2

This commit is contained in:
Garion Herman 2019-11-18 14:39:24 +13:00
commit 8db05ea5f0
2 changed files with 19 additions and 8 deletions

View File

@ -1,5 +1,11 @@
language: php
dist: xenial
services:
- mysql
- postgresql
env:
global:
- COMPOSER_ROOT_VERSION="2.x-dev"
@ -7,20 +13,24 @@ env:
matrix:
include:
- php: 5.6
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
env: DB=MYSQL PHPUNIT_TEST=1 RECIPE_VERSION="^1 --prefer-lowest"
- php: 7.0
env: DB=PGSQL PHPUNIT_TEST=1
env: DB=PGSQL PHPUNIT_TEST=1 RECIPE_VERSION="^1"
- php: 7.1
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1 RECIPE_VERSION="^4 --prefer-lowest"
- php: 7.2
env: DB=MYSQL PHPUNIT_TEST=1 PHPCS_TEST=1 RECIPE_VERSION="^4"
- php: 7.3
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1 RECIPE_VERSION="4.x-dev"
before_script:
- phpenv rehash
- phpenv config-rm xdebug.ini
- composer install --prefer-dist
- composer require --prefer-dist --no-update silverstripe/recipe-cms:1.0.x-dev
- if [[ $DB == PGSQL ]]; then composer require --prefer-dist --no-update silverstripe/postgresql:2.0.x-dev; fi
- composer update
- composer validate
- composer require --no-update silverstripe/recipe-cms:$RECIPE_VERSION
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:^2; fi
- composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi

View File

@ -13,6 +13,7 @@ use SilverStripe\Forms\TextField;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\SSViewer;
/**
* Widgets let CMS authors drag and drop small pieces of functionality into
@ -116,7 +117,7 @@ class Widget extends DataObject
*/
public function Content()
{
return $this->renderWith(array_reverse(ClassInfo::ancestry(__CLASS__)));
return $this->renderWith(SSViewer::get_templates_by_class(static::class));
}
/**