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.

remove relationship error

January 15, 2011 7:01am

Subscribe [2]
  • #1 / Jan 15, 2011 7:01am

    ahmedeng

    30 posts

    hello,

    since i updated to version 2.1.3 when i try to turn relationship field to normal text field i got an error :

    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 ee system path/expressionengine/fieldtypes/ft.rel.php on line 202

    actually i tried to fix the error by myself and i fixed it
    i just replace the lines 202,203,204 in ft.rel.php file ,

    from:
    $this->db->select(‘field_id_’.$data[‘field_id’]);
    $this->db->where(‘field_id_’.$data[‘field_id’].’ !=’, ‘0’);
    $rquery = $this->db->get(‘channel_data’);

    to:
    $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’);

    the error was php logic error (using db object without EE object because this object does not have db object but EE have db object.i just added EE before using db

    that’s my fix and it worked well.

    thanks,

  • #2 / Jan 15, 2011 6:00pm

    Greg Salt

    3988 posts

    Hi ahmedeng,

    Welcome to the forums!

    Thank you for your report. This bug has been previously reported and is marked as fixed for the next release.

    I’ll close this thread now but please post back if required. Again, thanks very much.

    Cheers

    Greg

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

ExpressionEngine News!

#eecms, #events, #releases