Skip to content

Commit

Permalink
Fix for #1314970. Don't generate a date string if the date is NULL or 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Oct 21, 2011
1 parent 94a1ba0 commit 5aa35bb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fhd_person/fhd_person_mapping/fhd_person_mapping.module
Expand Up @@ -61,8 +61,12 @@ function template_preprocess_fhd_person_mapping_block(&$vars) {
$person = $vars['person'];

$vars['person_link'] = l($person->name, 'person/' . $person->pid);
$vars['birth_string'] = adodb_date('Y', $person->birth_date) . ' ' . check_plain($person->birth_place);
$vars['death_string'] = adodb_date('Y', $person->death_date) . ' ' . check_plain($person->death_place);
if (!empty($person->birth_date)) {
$vars['birth_string'] = adodb_date('Y', $person->birth_date) . ' ' . check_plain($person->birth_place);
}
if (!empty($person->death_date)) {
$vars['death_string'] = adodb_date('Y', $person->death_date) . ' ' . check_plain($person->death_place);
}
}

function _fhd_person_mapping_ajax_callback() {
Expand All @@ -78,7 +82,7 @@ function _fhd_person_mapping_ajax_callback() {
}

/**
* @todo Create a searchable column so we can do fulltext search.
* @todo Create a searchable column so we can do fulltext search. http://drupal.org/node/1317404
**/
function _fhd_person_mapping_autocomplete($string) {
$matches = array();
Expand Down

0 comments on commit 5aa35bb

Please sign in to comment.