Skip to content

Commit

Permalink
Fields without content columns should default to no translation
Browse files Browse the repository at this point in the history
Resolves #3385
  • Loading branch information
brandonkelly committed Oct 18, 2018
1 parent 30850d5 commit 106c42e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

### Changed
- `craft\base\Field::supportedTranslationMethods()` now defaults to only returning `none` if the field type doesn’t have a content column. ([#3385](https://github.com/craftcms/cms/issues/3385))
- Craft.EntryTypeSwitcher now fires a `beforeTypeChange` event before swapping the Edit Entry form tabs. ([#3375](https://github.com/craftcms/cms/pull/3375))
- Craft.MatrixInput now fires an `afterInit` event after initialization. ([#3375](https://github.com/craftcms/cms/pull/3375))
- Craft.MatrixInput now fires an `blockAdded` event after adding a new block. ([#3375](https://github.com/craftcms/cms/pull/3375))
Expand Down
6 changes: 6 additions & 0 deletions src/base/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ public static function hasContentColumn(): bool
*/
public static function supportedTranslationMethods(): array
{
if (!static::hasContentColumn()) {
return [
self::TRANSLATION_METHOD_NONE,
];
}

return [
self::TRANSLATION_METHOD_NONE,
self::TRANSLATION_METHOD_SITE,
Expand Down

0 comments on commit 106c42e

Please # to comment.