ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Fatal error: called to method on a non-object

January 05, 2011 8:36pm

Subscribe [4]
  • #1 / Jan 05, 2011 8:36pm

    soapcreative

    9 posts

    Using EE v2.1.2 commercial.

    Steps to reproduce:

    1) Create a channel
    2) Create a custom field group
    3) Create a new field in the custom field group from step 2. Make this a relationship to the channel from step 1
    4) Delete the custom field created in step 3

    Result:

    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined property: Rel_ft::$db
    
    Filename: fieldtypes/ft.rel.php
    
    Line Number: 202
    
    Fatal error: Call to a member function select() on a non-object in /home/antz/Sites/(xxx).loc/trunk/(xxx)/expressionengine/fieldtypes/ft.rel.php on line 202

    Solution:

    Looking into the code in /home/antz/Sites/(xxx).loc/trunk/(xxx)/expressionengine/fieldtypes/ft.rel.php I identify the following code to be a problem:

    function settings_modify_column($data)
        {
            if ($data['ee_action'] == 'delete')
            {
                $this->db->select('field_id_'.$data['field_id']);
                $this->db->where('field_id_'.$data['field_id'].' !=', '0');
                $rquery = $this->db->get('channel_data');

           
    By changing the code to reference $this->EE->db instead, it appears to work as expected:

    function settings_modify_column($data)
        {
            if ($data['ee_action'] == 'delete')
            {
                $this->EE->db->select('field_id_'.$data['field_id']);
                $this->EE->db->where('field_id_'.$data['field_id'].' !=', '0');
                $rquery = $this->EE->db->get('channel_data')

           
    Please verify whether this is a bug and whether it should be lodged in the bug tracker, cheers.

  • #2 / Jan 06, 2011 11:02am

    Sue Crocker

    26054 posts

    Hi, soapcreative.

    EE2.1.2 had a number of problems. Can we have you upgrade to 2.1.3?

  • #3 / Jan 10, 2011 2:48am

    soapcreative

    9 posts

    Hi, soapcreative.

    EE2.1.2 had a number of problems. Can we have you upgrade to 2.1.3?

    Yep, we’ll get round to it sometime before launch. Did you want me to lodge a bug report or will you take care of it?

  • #4 / Jan 10, 2011 10:37am

    Sue Crocker

    26054 posts

    I don’t know if it is an issue with 2.1.3. Once you get a chance to upgrade, can you test again? I’d upgrade sooner than that. 😊

  • #5 / Jan 10, 2011 7:19pm

    soapcreative

    9 posts

    I don’t know if it is an issue with 2.1.3. Once you get a chance to upgrade, can you test again? I’d upgrade sooner than that. 😊

    You are the person who should be able to tell me which version the problem applies to. I’ll upgrade when it’s convenient, and yes I will test again then. But I won’t upgrade before it is necessary to in case 2.1.4 is released before launch. You have to pay for monkeys too you know 😉

  • #6 / Jan 11, 2011 9:16am

    Sue Crocker

    26054 posts

    This issue still remains in 2.1.3. I’ve posted a bug report on your behalf. Thanks for finding it, and my apologies for not looking it up earlier.

  • #7 / Jan 20, 2011 12:11pm

    Mindstorm Media

    2 posts

    Thanks for this post. I bumped into this bug too. Got it fixed now though.

  • #8 / Jan 20, 2011 3:27pm

    Ingmar

    29245 posts

    Glad to see that’s sorted. Please don’t hesitate to start a new thread as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases