×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Possible Bug? 'Item Saved Successfully'
Gary Hurdman
Fresh Boarder
Posts: 6
1 Jahr 7 Monate her #9994
von Gary Hurdman
Possible Bug? 'Item Saved Successfully' wurde erstellt von Gary Hurdman
Hi,
I think I have found a bug.
in the Model when a form is NOT saved because FALSE was passed back to the controller
public function save($data)
{...
.
.
if ($status !=6 && $status !=7)
{
$app->enqueueMessage(Text::_('WARNING! - This trader has is neither Casual or licensed - Status = '.$status), 'warning');
return false; //Don't save this data.
}
.
.
}
In the controller:
The 'Item Saved Successfully' message is always shown
I think it should be like this...
public function save($key = NULL, $urlVar = NULL)
{
.
.
.
.
// Check in the profile.
if ($return)
{
$model->checkin($return);
$this->setMessage(Text::_('COM_BCC_MACCS_MARKET_STALLS_ITEM_SAVED_SUCCESSFULLY'));
}
There doesn't appear to be any condition around the message otherwise???
Cheers - Paul
I think I have found a bug.
in the Model when a form is NOT saved because FALSE was passed back to the controller
public function save($data)
{...
.
.
if ($status !=6 && $status !=7)
{
$app->enqueueMessage(Text::_('WARNING! - This trader has is neither Casual or licensed - Status = '.$status), 'warning');
return false; //Don't save this data.
}
.
.
}
In the controller:
The 'Item Saved Successfully' message is always shown
I think it should be like this...
public function save($key = NULL, $urlVar = NULL)
{
.
.
.
.
// Check in the profile.
if ($return)
{
$model->checkin($return);
$this->setMessage(Text::_('COM_BCC_MACCS_MARKET_STALLS_ITEM_SAVED_SUCCESSFULLY'));
}
There doesn't appear to be any condition around the message otherwise???
Cheers - Paul
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Michael Cochran
Fresh Boarder
Posts: 2
9 Monate 1 Tag her - 9 Monate 1 Tag her #10204
von Michael Cochran
Michael Cochran antwortete auf Possible Bug? 'Item Saved Successfully'
It seems there might be a potential bug in the code. In the "Model" section, the "save" function checks for specific conditions, and if they are met, it returns false to prevent data from being saved. However, it doesn't seem to handle the message display properly in this case.
In the "Controller" section, after the data is saved, the "Item Saved Successfully" message is shown unconditionally. This means that even if the "save" function in the model returns false due to certain conditions, the success message will still be displayed, which could be misleading to the user. MyAccountAccess Login
To fix this, the "Controller" should check if the data was successfully saved or not by examining the return value of the "save" function in the "Model." If the save was successful, then display the success message; otherwise, show an appropriate warning or error message indicating that the data couldn't be saved due to the specific conditions not being met.
In the "Controller" section, after the data is saved, the "Item Saved Successfully" message is shown unconditionally. This means that even if the "save" function in the model returns false due to certain conditions, the success message will still be displayed, which could be misleading to the user. MyAccountAccess Login
To fix this, the "Controller" should check if the data was successfully saved or not by examining the return value of the "save" function in the "Model." If the save was successful, then display the success message; otherwise, show an appropriate warning or error message indicating that the data couldn't be saved due to the specific conditions not being met.
Letzte Änderung: 9 Monate 1 Tag her von Michael Cochran.
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Ladezeit der Seite: 0.109 Sekunden