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 202Solution:
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.