Skip to content
Snippets Groups Projects

fix the issue Passing null to parameter #1 () of type int|float to abs() is deprecated

1 file
+ 1
2
Compare changes
  • Side-by-side
  • Inline
+ 1
2
@@ -261,9 +261,8 @@ function template_preprocess_commerce_file_download_link(array &$variables) {
// Set file classes to the options array.
$variables['attributes'] = new Attribute($variables['attributes']);
$variables['attributes']->addClass($classes);
$variables['file_size'] = format_size($file->getSize());
$variables['file_size'] = $file->getSize() !== NULL ? format_size($file->getSize()) : t('Unknown');
$route_parameters = ['file' => $file->id()];
$variables['link'] = Link::fromTextAndUrl($link_text, Url::fromRoute('commerce_file.download', $route_parameters, $options))->toRenderable();
}
Loading