I’m trying to create an extension for EE2 and get a fatal error when I try to enable my new extension.
The error is:
Fatal error: Call to a member function insert_string() on a non-object in /path/to/expressionengine/third_party/[extension_name]/ext.[extension_name].php on line 33
That line corresponds to the activate_extension function:
function activate_extension() {
global $DB;
$DB->query($DB->insert_string('exp_extensions',
array(
'extension_id' => '',
'class' => $this->class_name,
'method' => "add_libraries",
'hook' => "publish_form_headers",
'settings' => "",
'priority' => 10,
'version' => $this->version,
'enabled' => "y"
)
)
);
}
Line 33 is the $DB->query($DB->insert_string(‘exp_extensions’... line.
Anyone had this happen?
Thanks in advance!
-Brett
