I'm creating a 'change password' for the user; I'm using php8.1 and Fuel version 1.9-dev
I have no other issues with other parts of my application thus far.
I've got a fieldset with validation, I'm not generating it from Model\Auth_User because I only need a couple of fields.
After $form->validation()->run() I have a known error but Session::set_flash('error', e($form->validation()->error())); shows nothing, but if I echo $form->show_errors(); I see my expected errors.
When I have no validation errors echo $form->show_errors(); shows empty array() and if ( ! $form->validation()->error()) fails.
Your fieldset looks exactly like how I would do it, I don't see any issue with it.
e($form->validation()->error())
won't work, becasuse error() returns an array, not a string, even if there is only one error message. So you need to iterate over it to show error messages.
I have no idea why
if ( ! $form->validation()->error())
would fail, as ( ! array() ) evaluates to True, that hasn't changed in PHP 8.1.
I changed e($form->validation()->error()) to $form->show_errors() and viola! Fixed that part..
The real problem was later.
I had thought that somehow if ( ! $form->validation()->error()) was failing because i wasn't seeing my exception. I realized that I had a typo - SimpleUserUpdaetException so I wasn't seeing the problem.
Once I fixed that I realized that I was passing arguments into Auth::change_password in the wrong order :facepalm:
Sometimes the answers are right in front of your face!