Post by prestin@surchx.com » Wed Jul 10, 2019 3:04 am

I have developed an extension for opencart and I have added an event using 'addEvent' method. The event is triggering properly but the issue is that upon uninstalling the extension I am getting some fatal error . this is the error I am getting "Fatal error: Uncaught Error: Call to a member function deleteEventByCode() on null"

My uninstall function is
public function uninstall() {
$this->load->model('setting/event');
$this->model_settings_event->deleteEventByCode('EVENTCODE');
}
Any help will be much appreciated


Posts

Joined
Wed Jun 19, 2019 1:27 am

Post by OSWorX » Wed Jul 10, 2019 4:27 am

Well, no wonder.
It should be:

Code: Select all

$this->model_setting_event->deleteEventByCode('EVENTCODE');
(1 s too much)

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by thekrotek » Wed Jul 10, 2019 5:27 am

Error message usually tells you, what's wrong. In your case the model (class) wasn't properly called and initiated.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by OSWorX » Wed Jul 10, 2019 2:44 pm

thekrotek wrote:
Wed Jul 10, 2019 5:27 am
Error message usually tells you, what's wrong. In your case the model (class) wasn't properly called and initiated.
No, not correct.
He called the model correct with:

Code: Select all

$this->load->model('setting/event');
but then he used:

Code: Select all

$this->model_settings_event->deleteEventByCode('EVENTCODE');
which is wrong (settings instead setting).

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 15 guests