Commit d0a9182e authored by Frank Bergmann's avatar Frank Bergmann

- fixed error when no tasks are there for default_material_id

parent 2a00a751
Pipeline #488 failed with stages
...@@ -70,20 +70,22 @@ if {"display" == $form_mode} { ...@@ -70,20 +70,22 @@ if {"display" == $form_mode} {
# most used material... # most used material...
set default_material_id [db_string default_cost_center " set default_material_id [db_string default_cost_center "
select material_id select material_id
from im_timesheet_tasks_view from im_timesheet_tasks_view
group by material_id group by material_id
order by count(*) DESC order by count(*) DESC
limit 1 limit 1
" -default ""] " -default ""]
if {"" == $default_material_id} { set default_material_id [im_material_default_material_id] }
# Deal with no default material # Deal with no default material
if {"" == $default_material_id} { if {"" == $default_material_id || 0 == $default_material_id} {
ad_return_complaint 1 " ad_return_complaint 1 "
<b>No default 'Material'</b>:<br> <b>No default 'Material'</b>:<br>
It seems somebody has deleted all materials in the system.<br> It seems somebody has deleted all materials in the system.<br>
Please tell your System Administrator to go to Home - Admin - Please tell your System Administrator to go to Home - Admin -
Materials and create at least on Material". Materials and create at least on Material.
" "
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment