Call_user_func_array() expects parameter 1 to be a valid callback, class 'CI_DB_mysql_driver' does not have a method 'create'

Hi I’m developing a module to write simple letters for a client, I’ve created the module of the back of quotes, using all the same calls, and inserted relevant code into the areas (of Toolbar, Dashboard, Client etc) to add to the UI, and removed code that wasn’t needed.

The problem i’m having is a php error:

A PHP Error was encountered
Severity: Warning
Message: call_user_func_array() expects parameter 1 to be a valid callback, class 'CI_DB_mysql_driver' does not have a method 'create'
Filename: core/MY_Model.php

Line Number: 72

The module uses the exact same create function as quotes, and invoices, to create letters. Displaying letters is fine, and I am able to copy letters, Just not create them.

Maybe you guys could shed some light on the situation to help me understand this :smile:


Do you created the same models like for quotes? Because the function only will not work like you see.

I have copied all relevant code I could find to duplicate quotes through the entire application, even editing the sql install / upgrade files so the tables would install on a clean install.

For the module other functions like Create PDF / copy Letter / save Letter etc work for the module (after manually adding entries to the database), it is just the creating new letters that it gives me this php error

In that case it would be good to take a look at the code itself.
Could you please upload the whole /application directory somewhere and post a link here?

Hi @Kovah Any luck looking into this?

No sorry had no time. I hope I can take a look today.

Hopefully you have had some luck, I keep going over the code again and again.
Thanks again Kovah, I appreciate your time.