Changes

Jump to navigation Jump to search
3,224 bytes added ,  20:53, 2 December 2019
no edit summary
Line 19: Line 19:  
| related_mods  =  [[Admin Media Search]], [[Gedcom Import Mediatype]], [[Gedcom Import Monitor]], [[Show Mod Names]]
 
| related_mods  =  [[Admin Media Search]], [[Gedcom Import Mediatype]], [[Gedcom Import Monitor]], [[Show Mod Names]]
 
| notes    =   
 
| notes    =   
}}
+
}}== Purpose of the Mod ==
== Purpose of the Mod ==
   
This mod changes the Gedcom Import process to
 
This mod changes the Gedcom Import process to
 
# Add a flag (a new database field) to Medialinks that are created by Gedcom Imports,
 
# Add a flag (a new database field) to Medialinks that are created by Gedcom Imports,
Line 32: Line 31:  
* May purge Place records or Places data that is not replaced by the Gedcom Import.
 
* May purge Place records or Places data that is not replaced by the Gedcom Import.
   −
=== Background ===
+
== Details ==
When the "pristine" (unchanged by a mod) Gedcom Import process starts, and you tell it to replace "all current data", TNG deletes all People, Families, Events, Notes, Citations, Sources, and Repositories in that tree, because TNG assumes that they will all be replaced from data in the Gedcom file. But it does not delete any Media Links at all, presumably because
+
=== Purging Places ===
* Many TNG admins don't count on Gedcom to load (all) of their media items and links, and instead manually create Media items and links, and 
+
<!-- *** BEGIN DOUBLE TOGGLE --><div class="mw-collapsible mw-customtoggle-places1 mw-customtoggle-places2" id='mw-customcollapsible-places1' style="text-decoration:underline;color:#0645ad;">&#91;Show Details&#93;</div>
* Gedcom does not support Medialinks for places or cemeteries, and any such links in the database must have been created manually, using TNG data entry screens.
+
<div class='mw-collapsible mw-collapsible-content mw-collapsed' id='mw-customcollapsible-places2' style="border:thin solid grey;"><!-- BEGIN TOGGLED CONTENT -->
 +
When the "pristine" (unchanged by a mod) Gedcom Import process starts - and "all current data" is being replaced - it deletes all People, Families, Events, Notes, Citations, Sources, and Repositories in the tree being loaded, assuming it will replace them with data in the Gedcom file.
   −
Note that
+
It is more careful with Places, since Places can contain data that cannot be (or is oftent not) loaded from Gedcom. Thus, when it purges Place records, it retains records that contain latitude or longitude values or descriptive notes. Still, it ignores placelevels and medialinks to Places, both of which cannot be loaded from Gedcom files.
# Media, Source, People, and Family records all have Gedcom IDs that should be (and almost always are) consistent from one Gedcom import to the next,
  −
# Medialink records form a link between a Media record and another object - specifically, a Source, Person, Family, Event, Place, or Cemetery,  
  −
# In Medialink records, (1) the mediaID field, (2) the awkwardly-named personID field (which might be a sourceID, personID, familyID, CemeteryID, or even a Placename), and (3) the eventID form a unique key, assuring that existing Source, People, and Family Medialinks to a given Media item are overwitten during a new Gedcom Import.
     −
Thus<br>
+
Consequently, the Gedcom Import Purge mod modifies the Places purge at the start of the Gedcom Import process so that it retains:
'''Problem 1''' - The Gedcom Import process retains Media links that have been deleted from the source database that produced the Gedcom, forcing the site Admin to delete those Medialinks manually (assuming that the Admin realizes that they exist).
+
* All Places when there are multiple trees, but just one Place list,
 +
* Places with a longitude, latitude, note, or placelevel value, and
 +
* Places with a Medialink.
 +
<!-- BUTTON AT THE BOTTOM OF TOGGLED CONTENT --><div class="mw-customtoggle-places1 mw-customtoggle-places2" style="text-decoration:underline;color:#0645ad;text-align:right;">&#91;Hide details&#93;</div>
 +
</div><!-- END TOGGLED CONTENT and END DOUBLE TOGGLE -->
   −
(Custom Events do not retain an eventID from one Gedcom Import to the next, so, for the moment, I cannot explain why old Custom Event medialinks do not survive a new Gedcom Import, but they do not. This result is surely related to the fact the that, in Medialinks to Events, the primary link relationship is to the personID or familyID (in the Medialinks.personID field), and eventID's, in effect, just modify those Medialinks.)
+
=== Purging Medialinks ===
 +
<!-- *** BEGIN DOUBLE TOGGLE --><div class="mw-collapsible mw-customtoggle-purgelinks1 mw-customtoggle-ppurgelinks2" id='mw-customcollapsible-purgelinks1' style="text-decoration:underline;color:#0645ad;">&#91;Show Details&#93;</div>
 +
<div class='mw-collapsible mw-collapsible-content mw-collapsed' id='mw-customcollapsible-purgelinks2' style="border:thin solid grey;"><!-- BEGIN TOGGLED CONTENT -->
 +
When the Gedcom Import Process purges data from the tree being loaded, it does not delete any Medialinks, presumably because
 +
* Many TNG admins don't count on GEDCOM to load (all) of their media items and links; they manually add other media items and links, and
 +
* Gedcom does not support medialinks for places or cemeteries, and any such links in the database must have been created manually, using the TNG editors
 +
However, as a result, Media links that have been deleted from the source database (that produced the Gedcom) will remain in TNG indefinitely, unless deleted manually
   −
Also, the "pristine" Gedcom Import process purges Places that ''do not have'' geocodes or descriptive notes, presumably because it assumes that Places without such data will be replaced (as needed) by the data in the Gedcom file. However, it does not pay attention to the Placelevel field, or to Medialinks. As a result, <br>
+
Consequently, the Gedcom Import Purge mod
'''Problem 2''' - The Gedcom Import process deletes Places that have Placelevels or Medialinks (but no geocodes or notes), thus deleting data that cannot be replaced by data in the Gedcom file.
+
# Installs a setup program that create a new database field named "createdbygedcom" for keeping track of Medialinks that are created by the Gedcom Import Process.
 +
# Modifies the Gedcom Import process to:
 +
## Use the new "createdbygedcom" Medialinks field to flag the Medialinks it creates and
 +
## Purge (delete) Medialinks that are flagged as having been created by a Gedcom Import - but only if the user checks the new "Purge media links created by previous Gedcom imports" checkbox in the Gedcom Import kickoff form,
 +
and
 +
# Modifies the Medialinks section of the Edit Media form to display and edit the "createdbygedcom" flag. The flag is turned off when new Medialinks are created, and, from that point, can be changed, though it is not likely to be changed.
 +
<!-- BUTTON AT THE BOTTOM OF TOGGLED CONTENT --><div class="mw-customtoggle-purgelinks1 mw-customtoggle-purgelinks2" style="text-decoration:underline;color:#0645ad;text-align:right;">&#91;Hide details&#93;</div>
 +
</div><!-- END TOGGLED CONTENT and END DOUBLE TOGGLE -->
    
=== Citation Medialinks ===
 
=== Citation Medialinks ===
This section describes how this mod addresses an an issue that was introduced in TNGv12, and how it could be addressed more effectively.
   
<!-- *** BEGIN DOUBLE TOGGLE --><div class="mw-collapsible mw-customtoggle-cm1 mw-customtoggle-cm2" id='mw-customcollapsible-cm1' style="text-decoration:underline;color:#0645ad;">&#91;Show Details&#93;</div>
 
<!-- *** BEGIN DOUBLE TOGGLE --><div class="mw-collapsible mw-customtoggle-cm1 mw-customtoggle-cm2" id='mw-customcollapsible-cm1' style="text-decoration:underline;color:#0645ad;">&#91;Show Details&#93;</div>
 
<div class='mw-collapsible mw-collapsible-content mw-collapsed' id='mw-customcollapsible-cm2' style="border:thin solid grey;"><!-- BEGIN TOGGLED CONTENT -->
 
<div class='mw-collapsible mw-collapsible-content mw-collapsed' id='mw-customcollapsible-cm2' style="border:thin solid grey;"><!-- BEGIN TOGGLED CONTENT -->
Line 102: Line 115:  
== Visualizations ==
 
== Visualizations ==
   −
{| border="1" cellspacing="1" cellpadding="2" class="wikitable"
+
{| border="3" cellspacing="1" cellpadding="2" class="wikitable"
 
|-
 
|-
! style="text-align:left;" | <span style="color: red">'''In the Mod Manager, After Installation'''</span>, showing the database setup hyperlink.
+
| <span style="color: red">'''In the Mod Manager, After Installation'''</span>, showing the database setup hyperlink.
 
|-
 
|-
 
| [[Image:gedcom_import_purge-modman.png]]
 
| [[Image:gedcom_import_purge-modman.png]]
 
|-
 
|-
! style="text-align:left;" | You must follow the hyperlink shown above to run the setup program that creates the database field through which TNG remembers which media links were created by a Gedcom Import. <span style="color: red">The program that installs the new database field looks like this:</span>
+
| You must follow the hyperlink shown above to run the setup program that creates the database field through which TNG remembers which media links were created by a Gedcom Import. <span style="color: red">The program that installs the new database field looks like this:</span>
 
|-
 
|-
 
| [[Image:gedcom_import_purge-createdb.png]]
 
| [[Image:gedcom_import_purge-createdb.png]]
Line 123: Line 136:  
## "Suppress the creation of citation medialinks" - It all depends on your Gedcom file and how you want to handle citation medialinks.
 
## "Suppress the creation of citation medialinks" - It all depends on your Gedcom file and how you want to handle citation medialinks.
 
|-
 
|-
! style="text-align:left;" | <span style="color: red">'''As the Gedcom Import starts:'''</span>
+
|''' <span style="color: red">'''As the Gedcom Import starts:'''</span>
 
|-
 
|-
 
| This message is visible only if you choose the "Old style import" checkbox (or, if you have installed [[Gedcom Import Monitor]], "Scrolling progress listing").
 
| This message is visible only if you choose the "Old style import" checkbox (or, if you have installed [[Gedcom Import Monitor]], "Scrolling progress listing").
 
<div> [[Image:gedcom_import_purge-purge.png]]</div>
 
<div> [[Image:gedcom_import_purge-purge.png]]</div>
 
'''Note that the Gedcom Import process will not purge any medialinks the ''first'' time you run it after installation, since the new database field hasn't yet been populated by flags that say that the Medialink was created by a Gedcom Import.'''
 
'''Note that the Gedcom Import process will not purge any medialinks the ''first'' time you run it after installation, since the new database field hasn't yet been populated by flags that say that the Medialink was created by a Gedcom Import.'''
 +
|}
 +
 +
{| border="3" cellspacing="1" cellpadding="2" class="wikitable"
 +
| <span style="color: red">'''Media Links in the Admin>>Media>>Edit form'''</span>
 +
|-
 +
| [[Image:gedcom_import_purge-after-medialinks.jpg]]
 +
|-
 +
The Medialinks table in the Media Edit form now has a column with a checkbox for the "From Gedcom" flag. It is checked for Media items that were loaded through a Gedcom Import process, and defaults to unchecked (and usually remains that way) when Media items are added within TNG.
 +
|}
 +
 +
{| border="3" cellspacing="1" cellpadding="2" class="wikitable"
 +
|-
 +
| <span style="color: red">'''The Mod Options - in a Mod Settings Block'''</span>
 +
<div>The Mod Settings Block for Gedcom Import Purge is at '''Admin>>Setup>>Import&nbsp;Settings'''. You can jump straight there from the "Change Mod Options" link in the Inner Mod Menu.</div>
 +
| [[Image:gedcom_import_purge-after-modsettingsblock.jpg]]
 
|}
 
|}
   Line 134: Line 162:  
! Mod Version !! TNG Version !! Date !! Note
 
! Mod Version !! TNG Version !! Date !! Note
 
|-  
 
|-  
| [[Media:gedcom_import_purg_v12.0.0.4.zip|12.0.0.4]]
+
| [[Media:gedcom_import_purge_v12.0.0.5.zip|12.0.0.5]]
 +
| 12.0+
 +
| 2 Dec 2019
 +
|
 +
# Modified the Place purge process so that it does not purge places on sites that have mulitple
 +
  trees and have one shared Places list.
 +
# Added an Inner Mod Menu, and moved the options to an Mod Settings Block
 +
# Added a form field in the Medialinks Admin>>Media>>Edit form so that admin users can set or unset the "createdfromgedcom" (aka "From Gedcom") flag.
 +
# Enhanced the message that, at the beginning of the Gedcom Import process, displays the counts of places and medialinks that were purged, and medialinks that were not purged.
 +
# The Gedcom Import process generates a list of the places that were purged and recreated, and purged and not recreated.
 +
# Added the "Suppress the creation of citation medialinks" checkbox on the Admin Gedcom Import kickoff form.
 +
# Added code to suppress citation medialinks when the checkbox is checked.
 +
# Adds a Save buttons to the left of the BodyText field in the Edit Media form, so that the user doesn'tab
 +
  always have to scroll to the top or bottom of the form to finish.
 +
|-
 +
| [[Media:gedcom_import_purge_v12.0.0.4.zip|12.0.0.4]]
 
| 12.0+
 
| 12.0+
 
| 15 May 2018
 
| 15 May 2018
Line 205: Line 248:  
[[Category:gedimport_trees.php mods]]
 
[[Category:gedimport_trees.php mods]]
 
[[Category:gedimport_misc.php mods]]
 
[[Category:gedimport_misc.php mods]]
[[Category:cust_text.php English mods]]
+
[[Category:admin_editmedia.php mods]]
 +
[[Category:js/mediafind.js mods]]
 +
[[Category:js/mediautils.js mods]]
 +
[[Category:micro_medialinks.php mods]]
 +
[[Category:ajx_updateorder.php mods]]
 +
[[Category:admin_importconfig.php mods]]
 +
[[Category:admin_updateimportconfig mods]]
 +
[[Category:data_help.php mods]]
 +
[[Category:English cust_text.php mods]]
'''Experienced'''
5,069

edits

Navigation menu