i follow series "Developing an MVC Component" on https://docs.joomla.org/J3.x:Developing_an_MVC_Component, but when i click to publish button, i have an error "Fatal error: Call to undefined method JmsMessagesModelMessages::publish() in E:\xampp\htdocs\joomla37\libraries\legacy\controller\admin.php on line 210". Somebody help me. I using joomla 3.7.5. Thanks.
Check the $name
and $prefix
variables that are passing over getModel
function on your controller.
$name
= NAME_OF_YOUR_EDIT_VIEW
$prefix
= COMPONENT_NAME + Model
"Fatal error: Call to undefined method JmsMessagesModelMessages::publish() in E:\xampp\htdocs\joomla37\libraries\legacy\controller\admin.php on line 210"
Like the error says, you don't have implemented a publish() function in your model.
Make one that changes the state for the column like you want on the database and it will work.