I'm finding many Notices and Warnings on the component.
I know that I could hide this by desabling the error on php.ini, but I don't like this aproach, so I rather clear all messages to have a nice writen code
So.. I'll be posting here some issues that I find and their solutions for those who likes to have clean code as well, and this can be used by the developers to fix those issues on futures releases
My first is related to a error that can be smilar to this:
Notice: Undefined property: stdClass::$params in ROOT\administrator\components\com_component_name\models\ticket.php on line 74
This is generated because the class $params was not initilized on model, so what you have to do is to find the function initData() and add the variable initilization, and it would be something like that
function _initData()
{
if (empty($this->_data))
{
//Default values shown in the form for new item creation
$data = new stdClass();
$data->id = 0;
$data->params = null;
$data->variable1 = null;
$data->variable2 = null;
//Add the line below to your code
$data->params = null;
$this->_data = $data;
return (boolean) $this->_data;
}
return true;
}
As you can see, just add the $data->params = null; in your code and this warning will desapear..
For Admin, would be nice for this to be initialized on next release...
Thank you all.. more to come