×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Frontend validation - probably controller bug
Dariusz
Fresh Boarder
Posts: 7
7 Jahre 9 Monate her #1488
von Dariusz
Frontend validation - probably controller bug wurde erstellt von Dariusz
102/5000
Validation does not work on the server side.
Currently it looks like this:It seems to me that it should be so:
Maybe I'm wrong, but after this modification, for me everything is working correctly
Validation does not work on the server side.
Currently it looks like this:
// Validate the posted data.
$data = $model->validate($form, $data);
// Check for errors.
if ($data === false)
{
some code here
}
// Attempt to save the data.
$return = $model->save($data);
// Check for errors.
if ($return === false)
{
some code here
}
// Check in the profile.
if ($return)
{
$model->checkin($return);
}
// Clear the profile id from the session.
$app->setUserState('com_pytania.edit.pytanie.id', null);
// Redirect to the list screen.
$this->setMessage(JText::_('COM_PYTANIA_ITEM_SAVED_SUCCESSFULLY'));
$menu = JFactory::getApplication()->getMenu();
$item = $menu->getActive();
$url = (empty($item->link) ? 'index.php?option=com_pytania&view=pytania' : $item->link);
$this->setRedirect(JRoute::_($url, false));
// Flush the data from the session.
$app->setUserState('com_pytania.edit.pytanie.data', null);
// Validate the posted data.
$data = $model->validate($form, $data);
// Check for errors.
if ($data === false)
{
some code here
} else {
// Attempt to save the data.
$return = $model->save($data);
}
// Check for errors.
if ($return === false)
{
some code here
}
// Check in the profile.
if ($return)
{
$model->checkin($return);
// Clear the profile id from the session.
$app->setUserState('com_pytania.edit.pytanie.id', null);
// Redirect to the list screen.
$this->setMessage(JText::_('COM_PYTANIA_ITEM_SAVED_SUCCESSFULLY'));
$menu = JFactory::getApplication()->getMenu();
$item = $menu->getActive();
$url = (empty($item->link) ? 'index.php?option=com_pytania&view=pytania' : $item->link);
$this->setRedirect(JRoute::_($url, false));
// Flush the data from the session.
$app->setUserState('com_pytania.edit.pytanie.data', null);
}
Maybe I'm wrong, but after this modification, for me everything is working correctly
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Andres Maeso
Platinum Boarder
Posts: 338
7 Jahre 9 Monate her #1492
von Andres Maeso
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!
Andres Maeso antwortete auf Frontend validation - probably controller bug
Hi.
My partners tell me that they successfully received the support ticket via the contact forum and this was fixed yesterday. Thanks for taking the time to report it!
My partners tell me that they successfully received the support ticket via the contact forum and this was fixed yesterday. Thanks for taking the time to report it!
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Ladezeit der Seite: 0.051 Sekunden