PDA

View Full Version : Error in db_adodb.php in tasks-list


lykfeldt
07-04-05, 10:52 PM
I've just upgraded from 1.0.2 to 2.0. I can see, edit and add projects, but when I go to the tasks-list I get this error:

ERROR: d:\inetpub\wwwroot\dotproject\includes\db_adodb.ph p(61): Error executing: SELECT
distinct tasks.task_id, task_parent, task_name, task_start_date, task_end_date, task_dynamic, task_pinned, pin.user_id,
task_priority, task_percent_complete, task_duration, task_duration_type, task_project,
task_description, task_owner, task_status, usernames.user_username, usernames.user_id, task_milestone,
assignees.user_username as assignee_username, count(distinct assignees.user_id) as assignee_count,
count(distinct files.file_task) as file_count, tlog.task_log_problem, history_date as last_update FROM tasks LEFT JOIN history ON history_item = tasks.task_id AND history_table='tasks' LEFT JOIN projects ON project_id = task_project LEFT JOIN users as usernames ON task_owner = usernames.user_id LEFT JOIN user_tasks as ut ON ut.task_id = tasks.task_id LEFT JOIN users as assignees ON assignees.user_id = ut.user_id LEFT JOIN task_log AS tlog ON tlog.task_log_task = tasks.task_id AND tlog.task_log_problem > '0' LEFT JOIN files on tasks.task_id = files.file_task LEFT JOIN user_task_pin as pin ON tasks.task_id = pin.task_id AND pin.user_id = 2 WHERE
task_project = 92
AND task_status = '0'
GROUP BY task_id
ORDER BY project_id, task_start_date
Backtrace:
0 d:\inetpub\wwwroot\dotproject\includes\db_adodb.ph p:61 dprint('d:\\inetpub\\wwwroot\\dotproject\\includes \\db_adodb.php',61,0,'Error executing: SELECT
distinct tasks.task_id, task_parent, task_name, task_start_date, task_end_date, task_dynamic, task_pinned, pin.user_id,
task_priority, task_percent_complete, task_duration, task_duration_type, task_project,
task_description, task_owner, task_status, usernames.user_username, usernames.user_id, task_milestone,
assignees.user_username as assignee_username, count(distinct assignees.user_id) as assignee_count,
count(distinct files.file_task) as file_count, tlog.task_log_problem, history_date as last_update FROM tasks LEFT JOIN history ON history_item = tasks.task_id AND history_table=\'tasks\' LEFT JOIN projects ON project_id = task_project LEFT JOIN users as usernames ON task_owner = usernames.user_id LEFT JOIN user_tasks as ut ON ut.task_id = tasks.task_id LEFT JOIN users as assignees ON assignees.user_id = ut.user_id LEFT JOIN task_log AS tlog ON tlog.task_log_task = tasks.task_id AND tlog.task_log_problem > \'0\' LEFT JOIN files on tasks.task_id = files.file_task LEFT JOIN user_task_pin as pin ON tasks.task_id = pin.task_id AND pin.user_id = 2 WHERE
task_project = 92
AND task_status = \'0\'
GROUP BY task_id
ORDER BY project_id, task_start_date')
1 d:\inetpub\wwwroot\dotproject\modules\tasks\tasks. php:288 db_exec('SELECT
distinct tasks.task_id, task_parent, task_name, task_start_date, task_end_date, task_dynamic, task_pinned, pin.user_id,
task_priority, task_percent_complete, task_duration, task_duration_type, task_project,
task_description, task_owner, task_status, usernames.user_username, usernames.user_id, task_milestone,
assignees.user_username as assignee_username, count(distinct assignees.user_id) as assignee_count,
count(distinct files.file_task) as file_count, tlog.task_log_problem, history_date as last_update FROM tasks LEFT JOIN history ON history_item = tasks.task_id AND history_table=\'tasks\' LEFT JOIN projects ON project_id = task_project LEFT JOIN users as usernames ON task_owner = usernames.user_id LEFT JOIN user_tasks as ut ON ut.task_id = tasks.task_id LEFT JOIN users as assignees ON assignees.user_id = ut.user_id LEFT JOIN task_log AS tlog ON tlog.task_log_task = tasks.task_id AND tlog.task_log_problem > \'0\' LEFT JOIN files on tasks.task_id = files.file_task LEFT JOIN user_task_pin as pin ON tasks.task_id = pin.task_id AND pin.user_id = 2 WHERE
task_project = 92
AND task_status = \'0\'
GROUP BY task_id
ORDER BY project_id, task_start_date')
2 d:\inetpub\wwwroot\dotproject\style\default\overri des.php:83 require('d:\\inetpub\\wwwroot\\dotproject\\modules \\tasks\\tasks.php')
3 d:\inetpub\wwwroot\dotproject\modules\projects\vie w.php:398 show()
4 d:\inetpub\wwwroot\dotproject\index.php:319 require('d:\\inetpub\\wwwroot\\dotproject\\modules \\projects\\view.php')
ERROR: d:\inetpub\wwwroot\dotproject\includes\db_adodb.ph p(84): Invalid object passed to db_num_rows
Backtrace:
0 d:\inetpub\wwwroot\dotproject\includes\db_adodb.ph p:84 dprint('d:\\inetpub\\wwwroot\\dotproject\\includes \\db_adodb.php',84,0,'Invalid object passed to db_num_rows')
1 d:\inetpub\wwwroot\dotproject\modules\tasks\tasks. php:289 db_num_rows(false)
2 d:\inetpub\wwwroot\dotproject\style\default\overri des.php:83 require('d:\\inetpub\\wwwroot\\dotproject\\modules \\tasks\\tasks.php')
3 d:\inetpub\wwwroot\dotproject\modules\projects\vie w.php:398 show()
4 d:\inetpub\wwwroot\dotproject\index.php:319 require('d:\\inetpub\\wwwroot\\dotproject\\modules \\projects\\view.php')

Fatal error: Call to a member function on a non-object in d:\inetpub\wwwroot\dotproject\includes\db_adodb.ph p on line 85
d:\inetpub\wwwroot\dotproject\includes\db_adodb.ph p(61): Error executing: SELECT
distinct tasks.task_id, task_parent, task_name, task_start_date, task_end_date, task_dynamic, task_pinned, pin.user_id,
task_priority, task_percent_complete, task_duration, task_duration_type, task_project,
task_description, task_owner, task_status, usernames.user_username, usernames.user_id, task_milestone,
assignees.user_username as assignee_username, count(distinct assignees.user_id) as assignee_count,
count(distinct files.file_task) as file_count, tlog.task_log_problem, history_date as last_update FROM tasks LEFT JOIN history ON history_item = tasks.task_id AND history_table='tasks' LEFT JOIN projects ON project_id = task_project LEFT JOIN users as usernames ON task_owner = usernames.user_id LEFT JOIN user_tasks as ut ON ut.task_id = tasks.task_id LEFT JOIN users as assignees ON assignees.user_id = ut.user_id LEFT JOIN task_log AS tlog ON tlog.task_log_task = tasks.task_id AND tlog.task_log_problem > '0' LEFT JOIN files on tasks.task_id = files.file_task LEFT JOIN user_task_pin as pin ON tasks.task_id = pin.task_id AND pin.user_id = 2 WHERE
task_project = 92
AND task_status = '0'
GROUP BY task_id
ORDER BY project_id, task_start_date
d:\inetpub\wwwroot\dotproject\includes\db_adodb.ph p(84): Invalid object passed to db_num_rows

petermac
08-04-05, 12:34 AM
I get the same thing... any resolutions yet ?

i_slovic
08-04-05, 02:37 AM
ERROR: /srv/www/htdocs/dotproject/includes/db_adodb.php(61): Error executing:
SELECT
distinct tasks.task_id, task_parent, task_name, task_start_date, task_end_date, task_dynamic, task_pinned, pin.user_id,
task_priority, task_percent_complete, task_duration, task_duration_type, task_project,
task_description, task_owner, task_status, usernames.user_username, usernames.user_id, task_milestone,
assignees.user_username as assignee_username, count(distinct assignees.user_id) as assignee_count,
count(distinct files.file_task) as file_count, tlog.task_log_problem, history_date as last_update FROM tasks LEFT JOIN history ON history_item = tasks.task_id AND history_table='tasks' LEFT JOIN projects ON project_id = task_project LEFT JOIN users as usernames ON task_owner = usernames.user_id LEFT JOIN user_tasks as ut ON ut.task_id = tasks.task_id LEFT JOIN users as assignees ON assignees.user_id = ut.user_id LEFT JOIN task_log AS tlog ON tlog.task_log_task = tasks.task_id AND tlog.task_log_problem > '0' LEFT JOIN files on tasks.task_id = files.file_task LEFT JOIN user_task_pin as pin ON tasks.task_id = pin.task_id AND pin.user_id = 1 WHERE
task_project = 27
AND task_status = '0'
GROUP BY task_id
ORDER BY project_id, task_start_date

Backtrace:
0 /srv/www/htdocs/dotproject/includes/db_adodb.php:61 dprint('/srv/www/htdocs/dotproject/includes/db_adodb.php',61,0,'Error executing:
SELECT
distinct tasks.task_id, task_parent, task_name, task_start_date, task_end_date, task_dynamic, task_pinned, pin.user_id,
task_priority, task_percent_complete, task_duration, task_duration_type, task_project,
task_description, task_owner, task_status, usernames.user_username, usernames.user_id, task_milestone,
assignees.user_username as assignee_username, count(distinct assignees.user_id) as assignee_count,
count(distinct files.file_task) as file_count, tlog.task_log_problem, history_date as last_update FROM tasks LEFT JOIN history ON history_item = tasks.task_id AND history_table=\'tasks\' LEFT JOIN projects ON project_id = task_project LEFT JOIN users as usernames ON task_owner = usernames.user_id LEFT JOIN user_tasks as ut ON ut.task_id = tasks.task_id LEFT JOIN users as assignees ON assignees.user_id = ut.user_id LEFT JOIN task_log AS tlog ON tlog.task_log_task = tasks.task_id AND tlog.task_log_problem > \'0\' LEFT JOIN files on tasks.task_id = files.file_task LEFT JOIN user_task_pin as pin ON tasks.task_id = pin.task_id AND pin.user_id = 1 WHERE
task_project = 27
AND task_status = \'0\'
GROUP BY task_id
ORDER BY project_id, task_start_date
')
1 /srv/www/htdocs/dotproject/modules/tasks/tasks.php:288 db_exec('SELECT
distinct tasks.task_id, task_parent, task_name, task_start_date, task_end_date, task_dynamic, task_pinned, pin.user_id,
task_priority, task_percent_complete, task_duration, task_duration_type, task_project,
task_description, task_owner, task_status, usernames.user_username, usernames.user_id, task_milestone,
assignees.user_username as assignee_username, count(distinct assignees.user_id) as assignee_count,
count(distinct files.file_task) as file_count, tlog.task_log_problem, history_date as last_update FROM tasks LEFT JOIN history ON history_item = tasks.task_id AND history_table=\'tasks\' LEFT JOIN projects ON project_id = task_project LEFT JOIN users as usernames ON task_owner = usernames.user_id LEFT JOIN user_tasks as ut ON ut.task_id = tasks.task_id LEFT JOIN users as assignees ON assignees.user_id = ut.user_id LEFT JOIN task_log AS tlog ON tlog.task_log_task = tasks.task_id AND tlog.task_log_problem > \'0\' LEFT JOIN files on tasks.task_id = files.file_task LEFT JOIN user_task_pin as pin ON tasks.task_id = pin.task_id AND pin.user_id = 1 WHERE
task_project = 27
AND task_status = \'0\'
GROUP BY task_id
ORDER BY project_id, task_start_date')
2 /srv/www/htdocs/dotproject/style/default/overrides.php:83 require('/srv/www/htdocs/dotproject/modules/tasks/tasks.php')
3 /srv/www/htdocs/dotproject/modules/projects/view.php:398 show()
4 /srv/www/htdocs/dotproject/index.php:319 require('/srv/www/htdocs/dotproject/modules/projects/view.php')


ERROR: /srv/www/htdocs/dotproject/includes/db_adodb.php(84): Invalid object passed to db_num_rows
Backtrace:
0 /srv/www/htdocs/dotproject/includes/db_adodb.php:84 dprint('/srv/www/htdocs/dotproject/includes/db_adodb.php',84,0,'Invalid object passed to db_num_rows')
1 /srv/www/htdocs/dotproject/modules/tasks/tasks.php:289 db_num_rows(false)
2 /srv/www/htdocs/dotproject/style/default/overrides.php:83 require('/srv/www/htdocs/dotproject/modules/tasks/tasks.php')
3 /srv/www/htdocs/dotproject/modules/projects/view.php:398 show()
4 /srv/www/htdocs/dotproject/index.php:319 require('/srv/www/htdocs/dotproject/modules/projects/view.php')


Fatal error: Call to a member function on a non-object in /srv/www/htdocs/dotproject/includes/db_adodb.php on line 85

Same thing here... anyone help? :)
My dotProject site is currently offline, and we're hoping we don't need to downgrade to 1.0.2

ajdonnison
08-04-05, 09:15 AM
Unfortunately neither of these error reports show the error that the database returned (unless I need new glasses). Could one of you cut and paste the select statement into either mysql or phpMyAdmin's SQL window to see if it works and if not what error is returned?

kicslinks
08-04-05, 03:46 PM
[quote="ajdonnison"]Unfortunately neither of these error reports show the error that the database returned (unless I need new glasses). Could one of you cut and paste the select statement into either mysql or phpMyAdminI am getting the same message as above when I click on the contacts name or the 'edit' beside the contacts name. I did not have this problem with 1.0

This is from copying the select statement into the SQL window:

Error
SQL-query:

SELECT company_id, company_name
FROM companies
WHERE company_name = KICS Links
LIMIT 0 , 30
MySQL said:

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Links LIMIT 0, 30' at line 1


This is the error I get when I click on the contacts name or the 'edit' beside the contacts name. The last line says there is an error in the SQL.

ERROR: /usr/home1/rightbr/public_html/contacts/includes/db_adodb.php(61): Error executing: SELECT company_id, company_name FROM companies WHERE company_name = KICS Links
Backtrace:
0 /usr/home1/rightbr/public_html/contacts/includes/db_adodb.php:61 dprint('/usr/home1/rightbr/public_html/contacts/includes/db_adodb.php',61,0,'Error executing: SELECT company_id, company_name FROM companies WHERE company_name = KICS Links')
1 /usr/home1/rightbr/public_html/contacts/includes/db_connect.php:93 db_exec(
Warning: Invalid argument supplied for foreach() in /usr/home1/rightbr/public_html/contacts/includes/main_functions.php on line 538
)
2 /usr/home1/rightbr/public_html/contacts/modules/contacts/contacts.class.php:115 db_loadhash(
Warning: Invalid argument supplied for foreach() in /usr/home1/rightbr/public_html/contacts/includes/main_functions.php on line 538
)
3 /usr/home1/rightbr/public_html/contacts/modules/contacts/view.php:38 getcompanydetails('SELECT company_id, company_name FROM companies WHERE company_name = KICS Links')
4 /usr/home1/rightbr/public_html/contacts/index.php:319 require('/usr/home1/rightbr/public_html/contacts/modules/contacts/view.php')
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Links' at line 1

Hope this helps...if not I'm willing to do more testing if you need.

kicslinks
08-04-05, 05:34 PM
I just went into the dpDev dotProject/Roadmap area and clicked on a contact name and this is the error message I received...


ERROR: /home/www/dp_admin/includes/db_adodb.php(61): Error executing: SELECT user_id FROM users WHERE user_contact =
Backtrace:
0 /home/www/dp_admin/includes/db_adodb.php:61 dprint('/home/www/dp_admin/includes/db_adodb.php',61,0,'Error executing: SELECT user_id FROM users WHERE user_contact = ')
1 /home/www/dp_admin/includes/db_connect.php:46 db_exec('SELECT user_id FROM users WHERE user_contact = ')
2 /home/www/dp_admin/modules/contacts/view.php:21 db_loadresult('SELECT user_id FROM users WHERE user_contact = ')
3 /home/www/dp_admin/index.php:317 require('/home/www/dp_admin/modules/contacts/view.php')
You have an error in your SQL syntax near '' at line 1

lykfeldt
08-04-05, 06:19 PM
It looks like the history-table is missing.

The SELECT-statement:

SELECT
distinct tasks.task_id, task_parent, task_name, task_start_date, task_end_date, task_dynamic, task_pinned, pin.user_id,
task_priority, task_percent_complete, task_duration, task_duration_type, task_project,
task_description, task_owner, task_status, usernames.user_username, usernames.user_id, task_milestone,
assignees.user_username as assignee_username, count(distinct assignees.user_id) as assignee_count,
count(distinct files.file_task) as file_count, tlog.task_log_problem, history_date as last_update FROM tasks LEFT JOIN history ON history_item = tasks.task_id AND history_table='tasks' LEFT JOIN projects ON project_id = task_project LEFT JOIN users as usernames ON task_owner = usernames.user_id LEFT JOIN user_tasks as ut ON ut.task_id = tasks.task_id LEFT JOIN users as assignees ON assignees.user_id = ut.user_id LEFT JOIN task_log AS tlog ON tlog.task_log_task = tasks.task_id AND tlog.task_log_problem > '0' LEFT JOIN files on tasks.task_id = files.file_task LEFT JOIN user_task_pin as pin ON tasks.task_id = pin.task_id AND pin.user_id = 2 WHERE
task_project = 92
AND task_status = '0'
GROUP BY task_id
ORDER BY project_id, task_start_date


The Error:

#1146 - Table 'dotproject.history' doesn't exist


Should I have a history-table? I can't find it in the sql-files.

i_slovic
09-04-05, 12:35 AM
mysql> SELECT distinct tasks.task_id, task_parent, task_name, task_start_date, task_end_date, task_dynamic, task_pinned, pin.user_id, task_priority, task_percent_complete, task_duration, task_duration_type, task_project, task_description, task_owner, task_status, usernames.user_username, usernames.user_id, task_milestone, assignees.user_username as assignee_username, count(distinct assignees.user_id) as assignee_count, count(distinct files.file_task) as file_count, tlog.task_log_problem, history_date as last_update FROM tasks LEFT JOIN history ON history_item = tasks.task_id AND history_table='tasks' LEFT JOIN projects ON project_id = task_project LEFT JOIN users as usernames ON task_owner = usernames.user_id LEFT JOIN user_tasks as ut ON ut.task_id = tasks.task_id LEFT JOIN users as assignees ON assignees.user_id = ut.user_id LEFT JOIN task_log AS tlog ON tlog.task_log_task = tasks.task_id AND tlog.task_log_problem > '0' LEFT JOIN files on tasks.task_id = files.file_task LEFT JOIN user_task_pin as pin ON tasks.task_id = pin.task_id AND pin.user_id = 1 WHERE task_project = 27 AND task_status = '0' GROUP BY task_id ORDER BY project_id, task_start_date;
ERROR 1054: Unknown column 'history_item' in 'on clause'


mysql> SELECT distinct tasks.task_id, task_parent, task_name, task_start_date, task_end_date, task_dynamic, task_pinned, pin.user_id, task_priority, task_percent_complete, task_duration, task_duration_type, task_project, task_description, task_owner, task_status, usernames.user_username, usernames.user_id, task_milestone, assignees.user_username as assignee_username, count(distinct assignees.user_id) as assignee_count, count(distinct files.file_task) as file_count, tlog.task_log_problem, history_date as last_update FROM tasks LEFT JOIN history ON history_item = tasks.task_id AND history_table='tasks' LEFT JOIN projects ON project_id = task_project LEFT JOIN users as usernames ON task_owner = usernames.user_id LEFT JOIN user_tasks as ut ON ut.task_id = tasks.task_id LEFT JOIN users as assignees ON assignees.user_id = ut.user_id LEFT JOIN task_log AS tlog ON tlog.task_log_task = tasks.task_id AND tlog.task_log_problem > '0' LEFT JOIN files on tasks.task_id = files.file_task LEFT JOIN user_task_pin as pin ON tasks.task_id = pin.task_id AND pin.user_id = 1 WHERE task_project = 27 AND task_status = '0' GROUP BY task_id ORDER BY project_id, task_start_date;
ERROR 1054: Unknown column 'history_item' in 'on clause'

Maybe this can help?

i_slovic
09-04-05, 12:46 AM
Another thing:

mysql> select * from tasks
-> ;
| task_id | task_name | task_parent | task_milestone | task_project | task_owner | task_start_date
| task_duration | task_duration_type | task_hours_worked | task_end_date | task_status | task_priority
| task_percent_complete | task_description | task_target_budget | task_related_url | task_creator
| task_order | task_client_publish | task_dynamic | task_access | task_notify | task_departments | task_contacts
| task_custom | task_type |

mysql> select * from history;
+------------+--------------+----------------+-----------------+---------------------+---------------------+
| history_id | history_user | history_module | history_project | history_date | history_description |
+------------+--------------+----------------+-----------------+---------------------+---------------------+


I don't have this history_item in table history for joining with table tasks :)

lykfeldt
09-04-05, 01:48 AM
I doesn't have the history-table at all. What is the create-query for this table, and why can't I find it in any sql-files in the db-folder?

kicslinks
09-04-05, 03:32 AM
[quote="lykfeldt"]I doesnThe history table is an option that you install by going to System Admin | View Modules | History | Install | Disabled (this will enable it) | Hidden (this will show it on the menu)

kicslinks
09-04-05, 05:54 AM
Changed line 61 of do_adodb.php to read:
dprint(__FILE__, __LINE__, 7, "Error executing: <pre>$sql</pre>"

Changed from: dprint(__FILE__, __LINE__, 0, "Error executing: <pre>$sql</pre>"

Now reciving only this error:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Laboratories' at line 1

ajdonnison
09-04-05, 10:14 AM
The problem with history tables is now fixed in the upcoming 2.0.1 release, in the meantime, just disable the history module.

lykfeldt
11-04-05, 07:12 PM
I've just upgraded to 2.0.1 - same problem.