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
{"success":1,"letter_id":{"table":"ip_letters","primary_key":"ip_letters.letter_id","date_modified_field":"letter_date_modified","default_limit":15,"page_links":null,"query":null,"form_values":{"client_name":"asd","letter_date_created":"02\/16\/2015","user_id":"1","invoice_group_id":"3"},"validation_errors":"","total_rows":null,"date_created_field":null,"native_methods":["select","select_max","select_min","select_avg","select_sum","join","where","or_where","where_in","or_where_in","where_not_in","or_where_not_in","like","or_like","not_like","or_not_like","group_by","distinct","having","or_having","order_by","limit"],"total_pages":0,"current_page":null,"next_page":null,"previous_page":null,"offset":null,"next_offset":null,"previous_offset":null,"last_offset":null,"id":null,"filter":[]}}

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:

Carl

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.