diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..778f3ce7f --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,14 @@ +## Affected Version + +Show version numbers by pasting the output of `composer info --direct`. +Alternatively, hover over the SilverStripe logo in the CMS to basic version information. + +## Description + +Describe expected and observed behaviour. +For visual issues, please include browser version and screenshots. +Please read https://docs.silverstripe.org/en/contributing/issues_and_bugs/ + +## Steps to Reproduce + +Help us with step-by-step instructions. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..be102f481 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ +Thanks for contributing, you're awesome! :star: +Please describe expected and observed behaviour, and what you're fixing. +For visual fixes, please include tested browsers and screenshots. +Search for related existing issues and link to them if possible. +Please read https://docs.silverstripe.org/en/contributing/code/ \ No newline at end of file diff --git a/src/ORM/DataObjectSchema.php b/src/ORM/DataObjectSchema.php index aa136cb65..18a616f59 100644 --- a/src/ORM/DataObjectSchema.php +++ b/src/ORM/DataObjectSchema.php @@ -3,15 +3,16 @@ namespace SilverStripe\ORM; use Exception; -use SilverStripe\Core\Injector\Injectable; +use InvalidArgumentException; +use LogicException; +use SilverStripe\Core\ClassInfo; +use SilverStripe\Core\Config\Config; use SilverStripe\Core\Config\Configurable; +use SilverStripe\Core\Injector\Injectable; use SilverStripe\Core\Injector\Injector; use SilverStripe\Dev\TestOnly; use SilverStripe\ORM\FieldType\DBComposite; -use SilverStripe\Core\ClassInfo; -use SilverStripe\Core\Config\Config; -use InvalidArgumentException; -use LogicException; +use SilverStripe\ORM\FieldType\DBField; /** * Provides dataobject and database schema mapping functionality @@ -316,7 +317,7 @@ class DataObjectSchema return $class; } - if (!ClassInfo::classImplements($class, TestOnly::class)) { + if (!ClassInfo::classImplements($class, TestOnly::class) && $this->classHasTable($class)) { trigger_error( "It is recommended to define a table_name for your '$class'." . ' Not defining a table_name may cause subsequent table names to be too long and may not be supported' . @@ -541,7 +542,6 @@ class DataObjectSchema */ protected function cacheDefaultDatabaseIndexes($class) { - $indexes = []; if (array_key_exists($class, $this->defaultDatabaseIndexes)) { return $this->defaultDatabaseIndexes[$class]; }