Project

General

Profile

« Previous | Next » 

Revision 61fc6c93

Added by Andreas Kohlbecker over 4 years ago

fix #8502 proper handling of tagged text for douptful taxa

View differences:

modules/cdm_dataportal/includes/name.inc
316 316

  
317 317
  normalize_tagged_text($tagged_title);
318 318

  
319
  $firstEntryIsValidNamePart =
319
  $is_valid_tagged_title =
320 320
    isset($tagged_title)
321 321
    && is_array($tagged_title)
322 322
    && isset($tagged_title[0]->text)
323 323
    && is_string($tagged_title[0]->text)
324 324
    && $tagged_title[0]->text != ''
325
    && isset($tagged_title[0]->type)
326
    && $tagged_title[0]->type == 'name';
325
    && isset($tagged_title[0]->type);
327 326
  $lastAuthorElementString = FALSE;
328 327

  
329 328
  $name_encasement = $is_invalid ? '"' : '';
......
332 331

  
333 332
  if($doubtful_marker){
334 333
    $doubtful_marker_markup = '<span class="doubtful">' . $doubtful_marker . '</span>';
334
    if($tagged_title[0]->text == '?' ){
335
      // remove the first tagged text element
336
      unset($tagged_title[0]);
337
    }
335 338
  }
336 339

  
337 340
  // split off all appendedPhrase item  from the end of the array (usually there only should  be one)
......
340 343
  }
341 344

  
342 345
  // Got to use second entry as first one, see ToDo comment below ...
343
  if ($firstEntryIsValidNamePart) {
346
  if ($is_valid_tagged_title) {
344 347

  
345 348
    $taggedName = $tagged_title;
346 349
    $hasNamePart_with_Authors = isset($renderTemplate['namePart']) && isset($renderTemplate['namePart']['authors']);
......
373 376
    $name = '<span class="' . $taxonName->class . '">' . $doubtful_marker_markup . $name_encasement . cdm_tagged_text_to_markup($taggedName, $skiptags) . $name_encasement . '</span>';
374 377
  }
375 378
  else {
379
    // use titleCache instead
376 380
    $name = '<span class="' . $taxonName->class . '_titleCache">' . $doubtful_marker_markup . $name_encasement . $taxonName->titleCache . $name_encasement . '</span>';
377 381
  }
378 382

  

Also available in: Unified diff