process names fields to always be Title Case
This commit is contained in:
@@ -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();
|
||||
/*
|
||||
|
Reference in New Issue
Block a user