Skip to content

Commit

Permalink
EWPP-3025: Add deprecation for calling smart_trim with a null length.
Browse files Browse the repository at this point in the history
  • Loading branch information
brummbar committed May 25, 2023
1 parent 4e89bff commit faee9df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/oe_theme_helper/src/TwigExtension/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,13 @@ protected function getIconPath(array $context, string $icon): string {
* The trimmed output.
*/
public function smartTrim(Environment $env, $input, $limit = 0) {
if ($limit === NULL) {
// phpcs:disable Drupal.Semantics.FunctionTriggerError
@trigger_error('Using the smart_trim filter with a null limit value is deprecated in oe_theme:3.x and will be removed in oe_theme:4.x releases.', E_USER_DEPRECATED);
// phpcs:enable
$limit = 0;
}

// Bubbles Twig template argument's cacheability & attachment metadata.
$this->bubbleArgMetadata($input);
$truncate = new TruncateHTML();
Expand Down

0 comments on commit faee9df

Please sign in to comment.