Issue Bug Closed

#91970TCA eval saltedPassword can return null, behaving different than the old BackendEvaluator of ext:saltedpasswords which only returned string, leading to SQL errors

S P 08/11/20, 07:56 updated 10/04/22, 14:12

Description

We have a custom field that uses the ext:saltedpasswords BackendEvaluator TCA validation to create salted passwords on a custom field.

After upgrading to v9 we switched to saltedPassword evaluation. This works for required fields, but not for optional fields in case an empty password is provided.

The old evaluator just returned the empty string if the entered password was empty. The new saltedPassword evaluation returns null however for empty strings. Which can lead to SQL errors if the column is defined as NOT NULL.

Our workaround is to explicitly trim after saltedPassword:

'eval' => 'password, saltedPassword, trim'

Either the new eval should be changed to return ?? '' or the new behaviour must be documented in the TCA docs.

(We use pbkdf2 if this matters.)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.