From 106c42ef3cce27b62037c3d923a8d72f7cec00b1 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Thu, 18 Oct 2018 06:07:52 -0700 Subject: [PATCH] Fields without content columns should default to no translation Resolves #3385 --- CHANGELOG-v3.md | 1 + src/base/Field.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index d2c8c17a084..0c794d6a115 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -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)) diff --git a/src/base/Field.php b/src/base/Field.php index a0cbac666c0..ff72589d32f 100644 --- a/src/base/Field.php +++ b/src/base/Field.php @@ -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,