From ee2dd78b3dcd0560c8aecbb5ab51ac5860846d20 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 22 Oct 2016 04:18:28 +1100 Subject: [PATCH] Exception handling for type: relation It would appear many plugins incorrectly use type: relation as a list column, when this does nothing. Previously it would fallback to the text type, now that invalid types fail hard, this adds a softer landing by spamming the trace log instead. Refs #2438 --- modules/backend/widgets/Lists.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index 3c92acc3c..cddbb5949 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -920,6 +920,16 @@ class Lists extends WidgetBase return $this->evalTextTypeValue($record, $column, $value); } + /** + * Common mistake, relation is not a valid list column. + * @deprecated Remove if year >= 2018 + */ + protected function evalRelationTypeValue($record, $column, $value) + { + traceLog(sprintf('Warning: List column type "relation" for class "%s" is not valid.', get_class($record))); + return $this->evalTextTypeValue($record, $column, $value); + } + /** * Process as partial reference */