You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When canceling any save, delete, update operation in beforeCreate(), beforeUpdate(), beforeDelete(), … a success message is still flashed to the user.
publicfunctionbeforeDelete()
{
if (some check) {
Flash::error('Not allowed to delete model');
returnfalse;
}
}
In the example above the delete is cancelled by the return false and the Flash::error is also shown. However the Flash::error is hidden behind the default Flash::success.
Shouldn't the success flash message not be shown at all, since the before method returned false?
(I am aware that a throw new ApplicationException('Not allowed to delete model.'); works fine, but I quite like the look of the flash message.)
The text was updated successfully, but these errors were encountered:
When canceling any save, delete, update operation in
beforeCreate()
,beforeUpdate()
,beforeDelete()
, … a success message is still flashed to the user.In the example above the delete is cancelled by the
return false
and the Flash::error is also shown. However the Flash::error is hidden behind the default Flash::success.Shouldn't the success flash message not be shown at all, since the before method returned false?
(I am aware that a
throw new ApplicationException('Not allowed to delete model.');
works fine, but I quite like the look of the flash message.)The text was updated successfully, but these errors were encountered: