Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
MariaDB 10.2
Did you customize Shield?
I customized the UserModel class to include a function to generate a full name of a user from their first and last name before insert and before update. I also customized the User entity class to include two functions to set the first and last name of a user after cleaning the string input and performing formatting on it like capitalization.
What happened?
I altered the users table and added four columns on it i.e. fullname, firstname, lastname and mobile. Then extended the UserModel class to add a function that generates a full name beforeInsert and beforeUpdate. The problem arises when the beforeUpdate fails to generate the full name and save it on the users table but the beforeInsert works as expected. I use the full name column for search purposes. Here is the code am using:
PHP Version
8.2.0
CodeIgniter4 Version
4.4.5
Shield Version
1.0.1
Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
MariaDB 10.2
Did you customize Shield?
I customized the
UserModel
class to include a function to generate a full name of a user from their first and last name before insert and before update. I also customized theUser
entity class to include two functions to set the first and last name of a user after cleaning the string input and performing formatting on it like capitalization.What happened?
I altered the
users
table and added four columns on it i.e.fullname
,firstname
,lastname
andmobile
. Then extended theUserModel
class to add a function that generates a full namebeforeInsert
andbeforeUpdate
. The problem arises when thebeforeUpdate
fails to generate the full name and save it on theusers
table but thebeforeInsert
works as expected. I use the full name column for search purposes. Here is the code am using:Steps to Reproduce
Make the
beforeUpdate
functionality work as expected i.e. make it execute the generate full name function.Expected Output
The full name gets generated and saved on the
users
table.Anything else?
No response