I've got a custom fieldtype I need to upgrade for EE 2.5.5 - It uses the Tools model, which was deprecated in EE 2.2. Here's the code that's coughing up errors in the developer log:
$upload_prefs = $this->EE->tools_model->get_upload_preferences($this->EE->session->userdata('group_id')); foreach ($upload_prefs->result() as $row) $upload_dirs[$row->id] = $row->name;
And here's the error:
The system has detected an add-on that is using outdated code that may stop working or cause issues with the system. What does this mean? Deprecated function get_upload_preferences() called in C:\Program Files\EasyPHP-12.1\www\EE\system\expressionengine\third_party\custom_fieldtype\ft.custom_fieldtype.php on line 272. Deprecated since 2.2. Use File_upload_preferences_model::get_file_upload_preferences() instead.
I've tried replacing tools_model->get_upload_preferences with file_upload_preferences_model->get_file_upload_preferences, but that gives us this:
Fatal error: Call to a member function result() on a non-object in C:\Program Files\EasyPHP-12.1\www\EE\system\expressionengine\third_party\custom_fieldtype\ft.custom_fieldtype.php on line 273
Any ideas how to fix this?