This question already has an answer here:
I’d like to override some files (.php and .xml) in /components/com_users/models. Can this even be done? Or should I try and make a modified/renamed copy of com_users?
What I am trying to do is: Remove the name field from the user profile and registration forms, replacing it with firstname and lastname. I also need to modify registration.php and profile.php, so that they stich together a name from
$firstname . ' ' . $lastname, because Joomla relies on name to be set to something meaningful.
This actually works if I edit the respective files directly, but my changes will be lost with an upgrade to Joomla. How can I avoid this?