× Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues

Possible Bug? 'Item Saved Successfully'

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

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

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.
Letzte Änderung: 9 Monate 1 Tag her von Michael Cochran.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Ladezeit der Seite: 0.109 Sekunden
Powered by Kunena Forum

Wir verwenden eigene Cookies und Cookies von Drittanbietern, um Ihr Nutzererlebnis zu verbessern und Ihnen einen optimalen Service zu bieten. Wenn Sie die Website weiter nutzen, gehen wir davon aus, dass Sie mit unserer Cookie-Politik einverstanden sind.