process names fields to always be Title Case

This commit is contained in:
2017-09-12 08:44:21 +10:00
parent 9910b523c6
commit 557b99966d
4 changed files with 52 additions and 30 deletions

View File

@@ -7,7 +7,7 @@ function booking_node_presave($node) {
if($node->type == 'booking') {
$title = t('!event registration: !name', array(
'!event' => $event->booking_eventname,
'!name' => $node->booking_firstname . ' ' . $node->booking_lastname,
'!name' => _booking_ucname($node->booking_firstname . ' ' . $node->booking_lastname),
));
//strip any emojis from user input if that feature is enabled
@@ -447,7 +447,12 @@ function booking_update($node) {
}
}
}
}
}
//make sure the name is the correct case
$data['booking_firstname'] = _booking_ucname($data['booking_firstname']);
$data['booking_lastname'] = _booking_ucname($data['booking_lastname']);
watchdog('booking', 'Updating node: @info', array('@info' => var_export($data, TRUE)));
db_update('booking_person')->fields($data)->condition('nid', $node->nid)->execute();
/*