diff -u b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php --- b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php +++ b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php @@ -180,31 +180,29 @@ return $dependencies; } - /** - * Shorten table name to avoid pgsql error on long alias names. - * - * @param string $table_name - * Table name. - * - * @return string - */ - private function shortenTableAlias(string $table_name) { - $new_alias = ''; - foreach (explode('_', $table_name) as $word) { - if (strlen($word) < 1) { - continue; - } - - if (strlen($word) < 4) { - $new_alias .= $word; - continue; - } - - $new_alias .= sprintf('%s%s', substr($word, 0, 2), substr($word, -2)); - } - - return !empty($new_alias) ? $new_alias : $table_name; - } + /** + * Shorten table name to avoid pgsql error on long alias names. + * + * @param string $table_name + * Table name. + * + * @return string + */ + private function shortenTableAlias(string $table_name) { + $new_alias = ''; + foreach (explode('_', $table_name) as $word) { + if (strlen($word) < 1) { + continue; + } + if (strlen($word) < 4) { + $new_alias .= $word; + continue; + } + + $new_alias .= sprintf('%s%s', substr($word, 0, 2), substr($word, -2)); + } + return !empty($new_alias) ? $new_alias : $table_name; + } }