Creation of Project with Template Causes 500 Error #10321
Labels
Area:Projects
Issues & PRs related to all things regarding to the Projects Module
Priority:Important
Issues & PRs that are important; broken functions, errors - there are workarounds
Status:Fix Proposed
A issue that has a PR related to it that provides a possible resolution
Type: Bug
Bugs within the core SuiteCRM codebase
Issue
When a project is created with a template a 500 error is generated:
Upon further investigation line 625:
$start = $startdate->format('Y-m-d');
$start_date is null after first iteration causing it to return Boolean false instead of the date.
Expected Behavior
The function should iterate through the loop and populate the $start_date with the start date of the task.
Actual Behavior
What actually happens is after the first loop, the $enddate_array[] is re-inialized causing it to be empty and thus causing the rest of the function to fail because a Boolean value false cannot be converted to a date.
Possible Fix
I've reviewed this recent update.
9aff707
Where:
$enddate_array = [];
is supposed to be inserted at line 330, but it's actually inserted on line 613
commenting it out at line 613 solves the problem and it works as expected.
Adding it back at line 330 causes no issues.
Steps to Reproduce
Context
This bug prevents projects from being created from templates.
Your Environment
The text was updated successfully, but these errors were encountered: