Deprecated function: str_replace(): Passing null to parameter Task->getEstimate()

Created on 18 September 2024, 5 months ago
Updated 19 September 2024, 5 months ago

Problem/Motivation

Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\burndown\Entity\Task->getEstimate() (line 834 of modules/contrib/burndown/src/Entity/Task.php).

Steps to reproduce

Add a new task with no estimation

Proposed resolution

public function getEstimate() {
if ($this->getEstimateType() == 'geometric') {
$estimate = $this->get('estimate')->value ?? '';
$estimate = str_replace('D', '', $estimate);
return $estimate;
}
return $this->get('estimate')->value ?? '';
}

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇷Argentina leofishman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024