Error: Call to a member function getEstimateSizes()

Created on 2 December 2024, about 1 month ago

Problem/Motivation

I am seeing the following issue after adding multiple projects and tasks. Can you explain the functionality to me so that I can help troubleshoot the error, please?

The website encountered an unexpected error. Try again later.

Error: Call to a member function getEstimateSizes() on null in Drupal\burndown\Form\TaskForm->buildForm() (line 82 of modules/contrib/burndown/src/Form/TaskForm.php).
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 284)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)

This is the code from the method.

  // Set estimate options based on project.
    $task = $form_state->getformObject()->getEntity();
    $project = $task->getProject();
    $options = $project->getEstimateSizes(); <--- This is throwing null
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia purencool

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

Comments & Activities

  • Issue created by @purencool
  • 🇨🇦Canada jeremylichtman

    You somehow have a task that doesn't have a project allocation.

    Burndown allows people to set different types of estimation sizing - i.e. some people like S/M/L, some like geometric like 1, 3, 5 points, some like length of time (half day, day, 2 days etc). These can be configured per project.

Production build 0.71.5 2024