openproject icon indicating copy to clipboard operation
openproject copied to clipboard

fix visibility scope of labor items

Open ulferts opened this issue 1 year ago • 0 comments

Fixes the visible scope of LaborBudgetItem. It was broken in multiple places:

  • Unless a project was provided, no scope (nil) was returned. In effect, that lead to the visible scope being inactive most of the time.
  • If a project was returned, the scope failed since it tried to find a non existing projects_id (instead of project_id) column on budgets.
  • When trying to actually run the scope that was supposed to be returned, that failed since there is no project_id column on the labor_budget_items table but only on the budgets table.

The second flaw suggests, that no project was ever provided as that would have lead to hard exceptions. The PR thus removes the second parameter which also brings the visibility scope more in line with those on other models.

Fixes

https://community.openproject.org/wp/45834

ulferts avatar May 06 '24 10:05 ulferts