Page 1 of 1

Cannot use object of type BugData as array

Posted: 18 Jul 2022, 12:17
by nabilelfilali
Hello
When I try to open some project I get the error message in PHP trace log file:

[18-Jul-2022 14:15:04 Europe/Berlin] Cannot use object of type BugData as array
C:\xampp\htdocs\mantis\mantisbt-2.25.4\core\helper_api.php: 471: - - - - custom_function_override_print_column_value( <string>'custom_issue_type', <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56293', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ) )
C:\xampp\htdocs\mantis\mantisbt-2.25.4\view_all_inc.php: 206: - - - - helper_call_custom_function( <string>'print_column_value', <array> { [0] => 'custom_issue_type', [1] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56293', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ) } )
C:\xampp\htdocs\mantis\mantisbt-2.25.4\view_all_inc.php: 213: - - - - write_bug_rows( <array> { [0] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56293', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [1] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57008', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [2] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56928', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [3] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57186', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [4] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56720', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [5] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57179', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [6] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57190', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [7] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56537', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [8] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57188', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [9] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56612', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P3' ), [10] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57191', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [11] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56786', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [12] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57071', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [13] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56490', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [14] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56999', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [15] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57189', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [16] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57163', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P3' ), [17] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56968', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [18] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57031', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [19] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56949', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [20] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56980', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [21] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56957', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [22] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56984', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [23] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57035', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [24] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57160', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [25] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57185', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [26] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57099', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [27] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56285', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [28] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56964', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [29] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57162', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [30] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57103', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [31] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57161', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [32] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57182', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [33] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57181', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [34] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57122', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P3' ), [35] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57125', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [36] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56902', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [37] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57077', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [38] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56829', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [39] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57140', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [40] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56932', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [41] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57169', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [42] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57105', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [43] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57146', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [44] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56851', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [45] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56453', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [46] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '57079', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [47] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56513', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ), [48] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56589', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P2' ), [49] => <Object><BugData> ( [attachment_count] => NULL, [bugnotes_count] => NULL, [business_line] => NULL, [product] => NULL, [domain] => NULL, [subdomain] => NULL, [responsible] => NULL, [bug_text_id] => '56301', [client] => NULL, [project_lot] => NULL, [tc_version] => NULL, [gt_version] => NULL, [c_priority] => 'P1' ) } )
C:\xampp\htdocs\mantis\mantisbt-2.25.4\view_all_bug_page.php: 112: - - - - include( <string>'C:\\xampp\\htdocs\\mantis\\mantisbt-2.25.4\\view_all_inc.php' )



Thank you in advance for your help

Re: Cannot use object of type BugData as array

Posted: 18 Jul 2022, 12:29
by cas
you have an error in your custom_function_override_print_column_value function. If you take out that function, the message most likely will disappear.
Problem is that Bugdata is an object and not an array hence needs to be treated differently :mrgreen:

Re: Cannot use object of type BugData as array

Posted: 19 Jul 2022, 09:50
by nabilelfilali
Thank you cas for your reply,
can you please show me how to do that because i'm not expert in PHP.
for information, i have upgraded from 1.5 to 2.25

Thank you very much for your kind support
Nabil

Re: Cannot use object of type BugData as array

Posted: 20 Jul 2022, 07:13
by cas
Hi Nabil,
in the config directory of your mantis installation, you should find a file called "custom_functions_inc.php".
Since you upgraded from 1.5 (which is strange since that version does not exists), it might also be found in the root of your Mantis installation.
THta file contains changes to the mantis installation which have been made in the past.
Check how many functions are there in that file.
If it is only one, to be precise "custom_function_override_print_column_value", then you could remove the file (after having backed up it first of course) and try again.
Be aware that the system may react differently since you took out a custom function.

You always can attach the file here so we can have a look together with you.

Re: Cannot use object of type BugData as array

Posted: 20 Jul 2022, 10:48
by nabilelfilali
Hello cas
thank you for your help
please find attached the file as request ,

I would like if you take a look on the function custom_function_override_print_column_value to see if we can fix the error

thank you very much again

Re: Cannot use object of type BugData as array

Posted: 20 Jul 2022, 11:52
by cas
Please attach the file...... :mrgreen:

Re: Cannot use object of type BugData as array

Posted: 20 Jul 2022, 12:15
by nabilelfilali
Attached a screenshot of the function, I couldn't attach php file

Re: Cannot use object of type BugData as array

Posted: 20 Jul 2022, 13:11
by cas
Please zip the php file and attach it :roll: