Menu

Individual List adds extra \

Help
2003-06-21
2003-06-24
  • Mark Hattam

    Mark Hattam - 2003-06-21

    Version 2.11

    Just noticed (with good eyesight) that my entry for a Margaret O'Brien works sometimes OK in the INDI view and the FAM view.

    But in the Individual List view, the name comes out as   O\'Brien, Margaret

    She also comes out as  O\'Brien, Margaret  when viewed from the husband's INDI view.

    And in the Family List, she comes with two \'s
    McMahon, John + O\\'Brien, Margaret

    Mark

     
    • John Finlay

      John Finlay - 2003-06-23

      I will fix this in the next version. 

      To fix it immediately change the following line in the buildindex.php from:
      $indilist["$gid"] =  addslashes($name);
      to:
      $indilist["$gid"] =  preg_replace('/"/', '\"', $name);

      --John

       
    • Mark Hattam

      Mark Hattam - 2003-06-23

      That's cured the instances of the single \'s

      And in the Family List she's gone from 2 \'s to a single \ ... ie still has one \
      ie
      McMahon, John + O\'Brien, Margaret

      (You didn't explicitly say, but I quickly sussed, that I had to update the gedcom and re-build the indexes)

       
    • John Finlay

      John Finlay - 2003-06-23

      Getting rid of the \ in the family requires changing the functions.php file.  Add the following line to the get_sortable_name function above line 314:
      $name = preg_replace('/"/', '\"', $name);

      Then erase the following line in the buildindex.php file:
      $famlist["$gid"] = addslashes($famlist["$gid"]);

      Then rebuild the indexes again.

      --John

       
    • Mark Hattam

      Mark Hattam - 2003-06-24

      Sorry, I'm unclear about where to add the line.

      In my functions.php (from version 2.11), function get_sortable_name runs from line 279 thru 307.

      then function get_family_descriptor runs from line 309 thru 313.

      Do you mean to add the line below the existing one in get_sortable_name that says
      $name = preg_replace("'\/'", "", $name);
      which at the moment is followed by
      return $name;

      Mark

       
    • John Finlay

      John Finlay - 2003-06-24

      Yes,  the last three lines of the get_sortable_name function should look like this:

      $name = preg_replace("'\/'", "", $name);
      $name = preg_replace('/"/', '\"', $name);
      return $name;

      The first replace gets rid of the forward slash around surnames.  The second adds backslashes before double quotes.  Then the name is returned.

      --John

       
    • Mark Hattam

      Mark Hattam - 2003-06-24

      Yep ... that's done the trick.

      Thank you

      Mark

       

Log in to post a comment.