I am doing bug fixes on already done Joomla project and I am a novice to Joomla. The issue is with the JToolBarHelper addNew button. We have two components- order and register. Both uses the add and edit buttons in front end. The function written for both component seems same in the view file.
protected function addToolBar()
{
if ($this->canDo->get('core.create'))
{
JToolBarHelper::addNew('form.add', '_NEW');
}
if ($this->canDo->get('core.edit'))
{
JToolBarHelper::editList('form.edit', '_EDIT');
}
}
For registration, both buttons works fine. On clicking add button it will go to page
www.test.net/index.php?option=com_register&view=form&layout=test&lang=en
What I also need to know is how this addNew function parameter works. Why it goes to the the layout test (which is correct in case of register layout). Is there something I miss? My real problem is, when I click on the add button in register, it goes to url with same params as above which is
www.test.net/index.php?option=com_order&view=form&layout=test&lang=en
and cause error that layout is missing.
Note: layout file "test" is there in register component but not in order.