I'm seeing the following when I try to publish or edit a pages entry : Fatal error: Call to a member function result_array() on a non-object in ...taxonomy/libraries/Ttree.php on line 1004

    foreach($query->result_array() as $row)

I'm getting a similar error about non-objects (whaaat) when I try to use Field Editor: Fatal error: Call to a member function result() on a non-object in ...field_editor/mcp.field_editor.php on line 70

line 70 (and context) is as follows:

    foreach ($query->result() as $row)
            anchor(BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=field_editor'.AMP.'method=edit'.AMP.'group_id='.$row->group_id, $row->group_name).sprintf(' (%d)', $row->count),
            anchor(BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=field_editor'.AMP.'method=delete_confirm'.AMP.'group_id='.$row->group_id, lang('delete')),
            anchor(BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=field_editor'.AMP.'method=export'.AMP.'group_id='.$row->group_id, lang('field_editor_export')),
            anchor(BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=field_editor'.AMP.'method=import_upload'.AMP.'group_id='.$row->group_id, lang('field_editor_import')),
            anchor(BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=field_editor'.AMP.'method=clone_group'.AMP.'group_id='.$row->group_id, lang('field_editor_clone'))

And then again when I try to change fields natively: Fatal error: Call to a member function num_rows() on a non-object in ...system/expressionengine/views/admin/field_group_management.php on line 28

        if ($field_groups->num_rows() > 0)
            foreach ($field_groups->result() as $field)
                    '<a href="'.BASE.AMP.'C=admin_content'.AMP.'M=field_management'.AMP.'group_id='.$field->group_id.'">'.$field->group_name.'</a> ('.$field->count.')', 
                    '<a href="'.BASE.AMP.'C=admin_content'.AMP.'M=field_group_edit'.AMP.'group_id='.$field->group_id.'">'.lang('rename').'</a>',
                    '<a href="'.BASE.AMP.'C=admin_content'.AMP.'M=field_group_delete_confirm'.AMP.'group_id='.$field->group_id.'">'.lang('delete').'</a>'

I can't reproduce on my staging server or locally so I've got a hunch that this is something server-specific, I just have no. clue. what it could be. Googling around, it looks like this sort of error (non-object) is pretty common so that at least gives me some hope.

Anyone have ideas on how I could resolve or could at least point me in the right direction? Trying to debug on a production server isn't ideal so ideally I'd like to have a starting point.

using v2.5.5 of EE taxonomy v2.3.4

  • 1
    If you can't reproduce this on your staging server, I would start by re-uploading all your EE files. Failing that, try duplicating your production database to staging and see if that triggers the error (that would point to corrupted data in your database). Make sure you have $debug = 1 set in index.php and admin.php on both sites. Mar 1 '13 at 10:26

If anyone is interested, EE was crapping out because the server admin had "secured" the server by putting the ORDER_FULL_GROUP_BY directive in the sql_mode of my.cnf.

I'm not entirely sure what it does but it seems to block some essential GROUP_BY queries. This didn't seem to be documented anywhere so hopefully somewhere down the road, this comes up useful for someone and saves them half a day of going down the rabbit hole.

  • Thanks for posting your solution. I'm sure this will help someone else at some point in the future! Mar 5 '13 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.