* Change Specific Fact - Error on run

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
avatar
ColinMc
Superstar
Posts: 458
Joined: 17 Jan 2019 11:35
Family Historian: V7
Location: Edinburgh

Change Specific Fact - Error on run

Post by ColinMc »

I thought I'd start this as a new topic although it appears to be linked to the topic Ability to Change Type of Fact (19623).

I ran the "Change Specific Fact " plugin today, and got this error.
Mil 1.jpg
Mil 1.jpg (21.07 KiB) Viewed 2384 times
I checked and there was no duplication of Label or Name
Mil 2.jpg
Mil 2.jpg (84.08 KiB) Viewed 2384 times
Having a look at the Military.fhf file, I see in my installed fact set, there is an attribute (No 21) called Military Pension. Looking at the new version of the fact set in the plug-in store (which I have NOT installed), I see that there is a new Event called Awarded Military Pension, but the older attribute is not present as far as I can see.

Interestingly, my installed version has a total of 25 Attributes and Events with Item nos, although there are 30 actual facts/attributes listed - presumably this is the error referred to in the KB page. But I see there are now 36 in the new version.
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Change Specific Fact - Error on run

Post by Mark1834 »

Sorry about that Colin. I’ll look into it and report back.

Agree starting a new thread, as it is a specific error rather than ongoing discussion about changing facts in general.
Mark Draper
avatar
ColinMc
Superstar
Posts: 458
Joined: 17 Jan 2019 11:35
Family Historian: V7
Location: Edinburgh

Re: Change Specific Fact - Error on run

Post by ColinMc »

Absolutely no need to apologise. You and the other plugin writers do us all a massive service, so thanks for all the effort


Colin
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Change Specific Fact - Error on run

Post by Mark1834 »

Could you post a copy of your Military Fact Set file please? There have been different versions over the years, so I'll need to work out what is different in yours compared with the current KB version (which doesn't give the error).
Mark Draper
avatar
ColinMc
Superstar
Posts: 458
Joined: 17 Jan 2019 11:35
Family Historian: V7
Location: Edinburgh

Re: Change Specific Fact - Error on run

Post by ColinMc »

Here's my file. I first used FH in 2017, so I imagine I downloaded my version very shortly after I bought it.

[.index]
Ver1=1
Ver2=0
Count=25
Item1=_ATTR-SERVICE-IA
Item2=_ATTR-RANK-IA
Item3=_ATTR-SERVICE_NO-IA
Item4=_ATTR-REGIMENT-IA
Item5=_ATTR-MEDAL-IA
Item6=EVEN-ENLISTED-IE
Item7=EVEN-DEMOBBED-IE
Item8=EVEN-TRANSFERRED-IE
Item9=_ATTR-CHEST_SIZE-IA
Item10=_ATTR-NEXT_OF_KIN-IA
Item11=_ATTR-MARKSSCARS-IA
Item12=_ATTR-TRADESKILL-IA
Item13=EVEN-MOBILISED-IE
Item14=_ATTR-DISABILITY-IA
Item15=EVEN-EMBARKED-IE
Item16=EVEN-MISSING-IE
Item17=EVEN-MILITARY_DESPATCHES-IE
Item18=_ATTR-COURTS_MARTIAL-IA
Item19=_ATTR-HOSPITALISED-IA
Item20=_ATTR-POSTING-IA
Item21=_ATTR-MILITARY_PENSION-IA
Item22=_ATTR-MILITARY_WOUNDED-IA
Item23=EVEN-DISEMBARKED-IE
Item24=_ATTR-PROMOTED-IA
Item25=_ATTR-THEATRE_OF_WAR-IA

[FCT-_ATTR-RANK-IA]
Name=Rank
Template={individual's} {label} was {value} {date} {place} {note}
Label=Military Rank
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-_ATTR-RANK-IA-Auto Note]
Count=0

[FCT-_ATTR-SERVICE_NO-IA]
Name=Service No.
Template={individual's} {label} was '{value}' {date} {place} {note}
Label=Military Service No.
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-_ATTR-SERVICE_NO-IA-Auto Note]
Count=0

[FCT-_ATTR-SERVICE-IA]
Name=Service
Template={individual} was in the {value} {date} {place} {note}
Label=Military Service
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-_ATTR-SERVICE-IA-Auto Note]
Count=0

[FCT-_ATTR-REGIMENT-IA]
Name=Regiment
Template={individual's} unit was the {value} {date} {place} {note}
Label=Military Regiment
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-_ATTR-REGIMENT-IA-Auto Note]
Count=0

[FCT-_ATTR-MEDAL-IA]
Name=Medal
Template={individual} was awarded the {value} medal {date} {place} {note}
Label=Medal
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-_ATTR-MEDAL-IA-Auto Note]
Count=0



[FCT-EVEN-ENLISTED-IE]
Name=Enlisted
Template={individual} enlisted {date} <at {_place}> {note}
Label=Enlisted
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-EVEN-ENLISTED-IE-Auto Note]
Count=0

[FCT-EVEN-DEMOBBED-IE]
Name=Demobbed
Template={individual} was demobbed {date}< at {%FACT.PLAC:SHORT%}.> {note}
Label=Demobbed
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-EVEN-DEMOBBED-IE-Auto Note]
Count=0

[FCT-EVEN-TRANSFERRED-IE]
Name=Transferred
Template={individual} was militarily transferred {date} <to {_place}> {note}
Label=Transferred
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-EVEN-TRANSFERRED-IE-Auto Note]
Count=0


[FCT-_ATTR-CHEST_SIZE-IA]
Name=Chest Size
Template={individual's} chest size was recorded as {value} {date} {place} {note}
Label=Chest Size
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-_ATTR-CHEST_SIZE-IA-Auto Note]
Count=0

[FCT-_ATTR-NEXT_OF_KIN-IA]
Name=Next of Kin
Template={individual's} next of kin was given as <{value}> {note}
Label=Next of Kin
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-_ATTR-NEXT_OF_KIN-IA-Auto Note]
Count=0

[FCT-EVEN-TO_ARMY_RESERVE-IE]
Name=Army Reserve
Template={individual} was put on military reserve {date} {place}
Label=Reserve
Abbr=
Hidden=N
Event Tab=
Rec Win=
[Text-FCT-EVEN-TO_ARMY_RESERVE-IE-Auto Note]
Count=0



[FCT-EVEN-AWARDED_PENSION-IE]
Name=Awarded Military Pension
Template={individual} was awarded a military pension {date} {place}
Label=Military Pension
Abbr=
Hidden=N
Event Tab=
Rec Win=
[Text-FCT-EVEN-AWARDED_PENSION-IE-Auto Note]
Count=0

[FCT-_ATTR-MARKSSCARS-IA]
Name=Marks/Scars
Template={individual's} marks & scars were {value} {date} {place} {note}
Label=Marks/Scars
Abbr=
Hidden=Y
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-_ATTR-MARKSSCARS-IA-Auto Note]
Count=0

[FCT-_ATTR-TRADESKILL-IA]
Name=Trade/Skill
Template={individual's} military trade/skill was '{value}' {date} {place} {note}
Label=Trade/Skill
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-_ATTR-TRADESKILL-IA-Auto Note]
Count=0

[FCT-EVEN-MOBILISED-IE]
Name=Mobilised
Template={individual} was mobilised {date} <from {_place}> {note}
Label=Mobilised
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-EVEN-MOBILISED-IE-Auto Note]
Count=0

[FCT-_ATTR-DISABILITY-IA]
Name=Disability
Template={individual's} military disability was '{value}' {date} {place} {note}
Label=Disability
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-_ATTR-DISABILITY-IA-Auto Note]
Count=0





[FCT-EVEN-EMBARKED-IE]
Name=Embarked
Template={individual} embarked< at {%FACT.PLAC:SHORT%}>< aboard the {=GetlabelledText(%FACT.NOTE2%,"Ship: ")}>< {date}>< {age}>< {=GetlabelledText(%FACT.NOTE2%,"Note: ")}.>
Label=Embarked
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-EVEN-EMBARKED-IE-Auto Note]
Count=4
Line1=n;[[;
Line2=n;Ship: ;
Line3=n;Note: ;
Line4=0;]];

[FCT-_ATTR-WEIGHT_MILITARY-IA]
Name=Weight
Template={individual's} weight in the forces was '{value}' {date} {place}
Label=Weight
Abbr=
Hidden=N
Event Tab=
Rec Win=
[Text-FCT-_ATTR-WEIGHT_MILITARY-IA-Auto Note]
Count=0

[FCT-EVEN-DISCHARGED_MILITARY-IE]
Name=Discharged
Template={individual} was discharged from the forces {date} {place} <to {address}>
Label=Discharged
Abbr=
Hidden=N
Event Tab=
Rec Win=
[Text-FCT-EVEN-DISCHARGED_MILITARY-IE-Auto Note]
Count=0




[FCT-EVEN-MISSING-IE]
Name=Missing
Template={individual} was reported missing in the forces {date} {place} {note}
Label=Missing
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-EVEN-MISSING-IE-Auto Note]
Count=0




[FCT-EVEN-MILITARY_DESPATCHES-IE]
Name=Military Despatches
Template={individual} was Mentioned in Despatches {date} {place} {note}
Label=Military Despatches
Abbr=
Hidden=N
Event Tab=
Rec Win=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
[Text-FCT-EVEN-MILITARY_DESPATCHES-IE-Auto Note]
Count=0
[FCT-_ATTR-COURTS_MARTIAL-IA]
Name=Courts Martial
Template={individual's} was charged with< - {value} -> {date} {place} {age}.< The Judge was {=GetlabelledText(%FACT.NOTE2%,"Judge: ")}.>< The verdict was - {=GetlabelledText(%FACT.NOTE2%,"Verdict: ")}.>< The punishment was - {=GetlabelledText(%FACT.NOTE2%,"Sentence: ")}.>< {=GetlabelledText(%FACT.NOTE2%,"Note: ")}.> {note}
Event Tab=
Rec Win=
Label=Courts Martial
Abbr=
Timeframe=MARRIAGE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
Hidden=N
[Text-FCT-_ATTR-COURTS_MARTIAL-IA-Auto Note]
Count=6
Line1=n;[[;
Line2=n;Judge: ;
Line3=n;Verdict: ;
Line4=n;Sentence: ;
Line5=n;Note:;
Line6=0;]];
[FCT-_ATTR-HOSPITALISED-IA]
Name=Hospitalised
Template={individual} was hospitalised < - {value} - > {date} {place} {age} {note}
Event Tab=
Rec Win=
Label=Hospitalised
Abbr=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
Hidden=N
[Text-FCT-_ATTR-HOSPITALISED-IA-Auto Note]
Count=0
[FCT-_ATTR-POSTING-IA]
Name=Posting
Template={individual} was posted to< {value}>< {_place}> {date} {age} {note}
Event Tab=Posting:< {value}>< {_place}>
Rec Win=
Label=Posting
Abbr=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
Hidden=N
[Text-FCT-_ATTR-POSTING-IA-Auto Note]
Count=0
[FCT-_ATTR-MILITARY_PENSION-IA]
Name=Military Pension
Template={individual} was awarded a military pension {date} {age} {note}
Event Tab=
Rec Win=
Label=Military Pension
Abbr=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
Hidden=N
[Text-FCT-_ATTR-MILITARY_PENSION-IA-Auto Note]
Count=0
[FCT-_ATTR-MILITARY_WOUNDED-IA]
Name=Military Wounded
Template=He suffered <{value}> {date} {place} {age} {note} {note}
Event Tab=Wounded: {value}
Rec Win=
Label=Military Wounded
Abbr=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
Hidden=N
[Text-FCT-_ATTR-MILITARY_WOUNDED-IA-Auto Note]
Count=0
[FCT-EVEN-DISEMBARKED-IE]
Name=Disembarked
Template={individual} disembarked {date} <at {%FACT.PLAC:SHORT%}> <{age}.>< {note}>
Event Tab=
Rec Win=
Label=Disembarked
Abbr=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
Hidden=N
[Text-FCT-EVEN-DISEMBARKED-IE-Auto Note]
Count=0
[FCT-_ATTR-COURTS_MARTIAL-IA-ROLE]
Roles=0
[FCT-_ATTR-DISABILITY-IA-ROLE]
Roles=0
[FCT-EVEN-ENLISTED-IE-ROLE]
Roles=0
[FCT-EVEN-DISEMBARKED-IE-ROLE]
Roles=0
[FCT-_ATTR-HOSPITALISED-IA-ROLE]
Roles=0
[FCT-EVEN-MILITARY_DESPATCHES-IE-ROLE]
Roles=0
[FCT-_ATTR-MILITARY_PENSION-IA-ROLE]
Roles=0
[FCT-_ATTR-RANK-IA-ROLE]
Roles=0
[FCT-_ATTR-REGIMENT-IA-ROLE]
Roles=0
[FCT-_ATTR-SERVICE-IA-ROLE]
Roles=0
[FCT-_ATTR-SERVICE_NO-IA-ROLE]
Roles=0
[FCT-_ATTR-MILITARY_WOUNDED-IA-ROLE]
Roles=0
[FCT-EVEN-MISSING-IE-ROLE]
Roles=0
[FCT-EVEN-MOBILISED-IE-ROLE]
Roles=0
[FCT-_ATTR-NEXT_OF_KIN-IA-ROLE]
Roles=0
[FCT-_ATTR-POSTING-IA-ROLE]
Roles=0
[FCT-_ATTR-TRADESKILL-IA-ROLE]
Roles=0
[FCT-EVEN-TRANSFERRED-IE-ROLE]
Roles=0
[FCT-_ATTR-PROMOTED-IA]
Name=Promoted
Template={individual} was promoted <to {value}> {date} {place} {age} {note}
Event Tab=
Rec Win=
Label=Promoted
Abbr=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
Hidden=N
[Text-FCT-_ATTR-PROMOTED-IA-Auto Note]
Count=0
[FCT-_ATTR-PROMOTED-IA-ROLE]
Roles=0
[FCT-EVEN-EMBARKED-IE-ROLE]
Roles=0
[FCT-_ATTR-THEATRE_OF_WAR-IA]
Name=Theatre of War
Template={individual} was in the <{value}> Theatre of War {date} {place} {age} {note}
Event Tab=
Rec Win=
Label=Theatre of War
Abbr=
Timeframe=LIFE
Field Date=1
Field Age=1
Field Place=1
Field Address=1
Field Note=1
Fast-Add Menu=N
Hidden=N
[Text-FCT-_ATTR-THEATRE_OF_WAR-IA-Auto Note]
Count=0
[FCT-_ATTR-THEATRE_OF_WAR-IA-ROLE]
Roles=0
[FCT-EVEN-DEMOBBED-IE-ROLE]
Roles=0
[FCT-_ATTR-CHEST_SIZE-IA-ROLE]
Roles=0
[FCT-_ATTR-MEDAL-IA-ROLE]
Roles=0
[FCT-_ATTR-MARKSSCARS-IA-ROLE]
Roles=0
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Change Specific Fact - Error on run

Post by Mark1834 »

Colin,

Thanks for that. I can see that the Fact Set file is badly corrupted. There are two facts with the same "Military Pension" label, namely Awarded Military Pension (event) and Military Pension (attribute). Only the latter is included in the index section and displayed in the FH user interface. There are several other facts defined but not indexed, and one indexed but not defined!

I haven't kept a copy of the earlier file that I downloaded from the KB, but yours is significantly more messed up than that one was. It's not clear whether the problems have arisen to a bug in an old version of FH, or manual editing of the file prior to uploading. I asked for witnesses, but nobody admitted to seeing anything... ;)

The easiest fix was to manually edit the Fact Set file to match what was displayed in FH. That means you can carry on using the same set of facts without the risk of creating orphans. It could get a bit messy if you want the additional facts in the current KB file, but it should be possible to load both with the appropriate priority order.

To get this new Fact Set file into your copy of FH, either rename the file to match your existing set and overwrite the existing one with this copy, or copy the contents of this file into your current set, replacing the original text.
Attachments
Military (MD-mod).fhf
(20.13 KiB) Downloaded 45 times
Mark Draper
avatar
ColinMc
Superstar
Posts: 458
Joined: 17 Jan 2019 11:35
Family Historian: V7
Location: Edinburgh

Re: Change Specific Fact - Error on run

Post by ColinMc »

Thanks for investigating Mark,

I'll replace the existing one with the new version from the KB. Thanks again
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Change Specific Fact - Error on run

Post by tatewise »

Mark, I wonder how many corrupted Fact Set files there are out there.
It seems that FH does not do much to validate the Fact Set file format and structure.
Should that be reported to CP, or should Fact Set file validation be added to a plugin such as Show Project Statistics that checks for all manner of exceptions?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ColeValleyGirl
Megastar
Posts: 5465
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Change Specific Fact - Error on run

Post by ColeValleyGirl »

tatewise wrote: 30 Jul 2022 10:36 Mark, I wonder how many corrupted Fact Set files there are out there.
It seems that FH does not do much to validate the Fact Set file format and structure.
Should that be reported to CP, or should Fact Set file validation be added to a plugin such as Show Project Statistics that checks for all manner of exceptions?
Confusing to rename it now, but that plugin desperately needs a more accurate name. I would never have dreamed of running it because I'm not interested n project statistics.
avatar
ColinMc
Superstar
Posts: 458
Joined: 17 Jan 2019 11:35
Family Historian: V7
Location: Edinburgh

Re: Change Specific Fact - Error on run

Post by ColinMc »

I suspect that there could well be quite a lot of corrupt fact sets. If that suspicion is correct, would not validation of fact sets merit a Validation plugin on its own? It does not seem to fit logically inside a statistics plugin.

Of course its very easy for me to say this as I would not have any chance of making such a plugin (or indeed any plugin).
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Change Specific Fact - Error on run

Post by tatewise »

Helen, I agree. It started out with a limited scope of Wish List Ref 191 File Summary Display and Show Project Statistics seemed reasonable at the time 10 years ago, but like most plugins, its scope has enlarged often in response to user requests.
Perhaps a new plugin with a new name could be published and the old plugin reduced to a shell that simply tells the user to run the new plugin. Alternatively, the Plugin Store needs a rename and redirection feature so that the old plugin name is still listed but redirects users to the new plugin. Similar discussions have occurred for other plugins.

Colin, as Helen has alluded to, this plugin reports more than just statistics and reports a whole range of exceptions.
Its Plugin Store summary says:
This plugin displays a summary of statistics for the Project and reports any exceptional data in a Result Set after closure.
The Help pages give more detailed explanations of what is reported.
In particular see: Show Project Statistics Result Set Exceptions Report.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
ColinMc
Superstar
Posts: 458
Joined: 17 Jan 2019 11:35
Family Historian: V7
Location: Edinburgh

Re: Change Specific Fact - Error on run

Post by ColinMc »

Colin, as Helen has alluded to, this plugin reports more than just statistics and reports a whole range of exceptions.
Its Plugin Store summary says:
I was aware of that, I was trying to avoid suggesting too much work for authors. I had deliberately not suggested what I had been thinking, which was to revert the old plugin to a statistics role - As per its name - and moving its "Other" validation functions to a new Validation plugin alongside the Fact sets. That might help to reduce the confusion in naming.

I sort of hoped that that course would become a natural development either immediately, or at a later stage, if someone (ie one of the few of you) had volunteered to take it on.
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Change Specific Fact - Error on run

Post by Mark1834 »

The same thoughts occurred to me as I was fixing this particular example. It's a difficult one to report to CP, as all we can say is that an unknown version of FH has generated inconsistent Fact Sets at some point in time. There may be overlap with the RM Import Fact Set issue (which CP know about), so I agree that we need an easy to use plugin fix as the issue is bound to arise again. I think the main problem is that the Fact Set index section is not consistent with the detailed definitions.

My preference is for a dedicated "system check" plugin, as it is a slightly different issue to reporting data stats and consistency. Philosophically, I also prefer more and simpler plugins, as these are likely to prove more robust than large complex ones dependant on a single individual for maintenance.

If we want such a plugin to be useable in all versions of FH, that puts the ball squarely in Mike's court, as I strongly doubt that any other author would be prepared to embrace the complexity of manipulating UFT-16 Fact Sets without access to the enhanced tools in FH7.

If on the other hand we are happy with a "system check" plugin being FH7 only, I'm happy to lift the code in the recent RM Audit plugin (which does more or less what I described above already) and use that as the basis of a new plugin that will gradually evolve with other similar functions.

No single solution that ticks all the boxes, but I'm confident that we can arrive at a consensus on the best way forward.
Mark Draper
User avatar
ColeValleyGirl
Megastar
Posts: 5465
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Change Specific Fact - Error on run

Post by ColeValleyGirl »

tatewise wrote: 30 Jul 2022 11:54 Helen, I agree. It started out with a limited scope of Wish List Ref 191 File Summary Display and Show Project Statistics seemed reasonable at the time 10 years ago, but like most plugins, its scope has enlarged often in response to user requests.
Perhaps a new plugin with a new name could be published and the old plugin reduced to a shell that simply tells the user to run the new plugin. Alternatively, the Plugin Store needs a rename and redirection feature so that the old plugin name is still listed but redirects users to the new plugin. Similar discussions have occurred for other plugins.
Perhaps the 'Superseded by' field in the plugin store might help?
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Change Specific Fact - Error on run

Post by tatewise »

Mark1834 wrote: 30 Jul 2022 13:01 My preference is for a dedicated "system check" plugin, as it is a slightly different issue to reporting data stats and consistency. Philosophically, I also prefer more and simpler plugins, as these are likely to prove more robust than large complex ones dependant on a single individual for maintenance.
The data and exceptions that the Show Project Statistics plugin reports don't fall neatly into two camps.
They cover a spectrum of issues from potential data entry mistakes, through more definite data errors, to system errors.
Also, the exceptions are often indicated by highlighting associated regular statistics in red.
However, in this case, maybe a dedicated plugin would be better.
But I don't see why we should be doing what CP should be doing.
Regardless of how it has arisen, only FH would have created the Fact Set files with those corruptions and so FH should do a better job of ratifying their format, in much the same way is it does for GEDCOM files and direct imports from other products.
i.e. I'm not suggesting CP correct the cause of the corruptions but when loading the Fact Set files it validates their format and reports errors if it cannot fix them automatically.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Change Specific Fact - Error on run

Post by Mark1834 »

I think I know what the root cause of this problem is. Colin's Fact Set contains a number of facts where there are no definitions for either the Normal Time Frame or the fields to be displayed (Date, Place, etc), and they do not appear in the Index section of the Fact Set file. As a result, they are completely invisible to the user through the normal FH user interface.

The Change Specific Fact Tag plugin was complaining that there were two facts with the same label, but this was not apparent to the user as one of them was invisible, as above. If I change one of the duplicate labels outside FH using a text editor, the plugin runs normally and ignores the invisible facts.

If I run the Change Any Fact Tag plugin with the same Fact Set file, the invisible facts are included in the dropdown of new facts (including the duplicated label). If I try to change an existing fact to one of the invisible ones, it gives a warning that it cannot make the change, but without further explanation.

That gives us something a bit more specific to report to CP. It appears as thought at some point in the past, FH did not save this supplementary information correctly. It is perhaps surprising that this was not picked up at the time as users created Fact Sets, but it is what it is.

I'll raise a ticket with CP, suggesting that FH checks for missing values, and replaces with default ones. I'll also go through the other Fact Set files in the KB later to see if any other ones are affected.
Mark Draper
User avatar
ColeValleyGirl
Megastar
Posts: 5465
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Change Specific Fact - Error on run

Post by ColeValleyGirl »

Mark1834 wrote: 31 Jul 2022 09:08

I'll raise a ticket with CP, suggesting that FH checks for missing values, and replaces with default ones. I'll also go through the other Fact Set files in the KB later to see if any other ones are affected.
My only concern is that a Fact without a Timeframe or any of place, date, address, note, etc. is a perfectly valid fact... It ought to be visible, but I'd be a little narked if CP modified a valid fact.
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Change Specific Fact - Error on run

Post by Mark1834 »

Agree - so the defaults need to be Timeframe = NONE and Field xxx = 0. It's missing values that seem to upset FH.
Mark Draper
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Change Specific Fact - Error on run

Post by Mark1834 »

Update from recent testing - I have put together a quick plugin that checks Fact Sets for consistency. None of the Fact Sets on the KB show any problems. They are fairly well spread out in origin from 2006 to 2021. I also don't remember any issue on the forum with disappearing facts (and none of the long-service regulars have flagged anything, either).

Leaving aside the RM import issue, which probably has a different root cause and is being fixed by CP anyway, this seems to indicate that the only Fact Set affected is the old version of the Military set that was on the KB for many years.

There is a bit of variability in Fact Set layout, so I have modified the Change Specific Fact Tag plugin to cope with both this and existing copies of the flawed Military Fact Set. It will now mirror the FH behaviour of ignoring any facts that don't have both an index entry and a definition. I need to do a few more tests, but it should be uploaded to the store later this week.

There's a good learning point for plugin authors here. Fact Set structure is not documented, so we shouldn't assume that they are all the same. It was a simple change to modify the file import to make it more robust, so is worth doing for all plugins that read fact sets.
Mark Draper
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Change Specific Fact - Error on run

Post by tatewise »

After recently finding some features needed updating in my Change Any Fact Tag plugin, I have performed some experiments with the Change Specific Fact plugin and found a few issues...
  1. If any Fact definitions have a Name/Label using UTF-8 characters they are displayed incorrectly in the menus.
    The solution is to insert these script lines to set IUP GUI into UTF-8 mode:
    iup.SetGlobal("UTF8MODE","YES")
    iup.SetGlobal("UTF8MODE_FILE","YES")
  2. If two Facts have the same Name/Label then the plugin complains and will not proceed.
    If such a pair of Facts are an Event and an Attribute, or an Individual and a Family fact, then there is no conflict as they never appear in the same menu, so should be tolerated.
    Another possibility is that the pair are in different Fact Sets, so by adding the Fact Set Name in brackets they could be differentiated, although this is unlikely to be needed.
I was pleased that otherwise it coped with multiple local Project Fact Sets and file paths containing UTF-8 characters.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Change Specific Fact - Error on run

Post by Mark1834 »

Good catch on UTF names, thanks - I'll add that to the next update.

Complaining about duplicated fact Name/Label, even with different flavours, was actually a deliberate design choice. FH permits it, but IMO it is very bad practice and potentially leads to all sorts of confusion. I could soften it to an "on your head be it" warning, but I'm minded to keep it strict, as I can't think of any circumstances where the duplication would be justified or necesary.
Mark Draper
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Change Specific Fact - Error on run

Post by tatewise »

It has been a common case that when importing from other products bother an Attribute and an Event gets created with the same Name/Label. That happens because some of the facts have a value and others don't.
Currently, that situation inhibits this plugin entirely from changing anything until it is resolved.
One way of resolving it is to change the Events as they are discovered one by one into the Attribute of the same Name/Label, but that is not currently possible with this plugin unless one of the Labels is changed.

A similar situation can arise where the other product has similarly named Individual and Family facts, although in that case, it would make sense to add (family) to the Family one to resolve the conflict.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Change Specific Fact - Error on run

Post by Mark1834 »

That's an interesting scenario, as I had not considered imports from other products.

I think it would be more logical for a global change such as that to be handled in the Change Any Fact Tag plugin, as that is designed to be used for cleaning up imported data. There could be a large number of such Facts, so changing them one at a time would not be ideal.

To test that situation, I created a pair of Custom Facts with the same name/label, one an Event and the other an Attribute, and added one example of each to the same individual in the Sample Project. Change Any Fact Tag didn't seem able to change one to the other, as the Change button remained greyed out whichever fact I selected. I then created a new Custom Attribute (to preserve the existing Attribute value), and tried changing both to that new Fact. Changing the Attribute Fact was fine, but when I tried to change the Event, the plugin didn't find the Fact to change, and reported that "No '_ATTR-JUNK: junk' items edited" (where junk is the name of my disposable pair of test facts).

I interpret this as the plugin getting confused, and offering the junk Event in the selection menu (as the only one remaining), but trying to make the change on the junk Attribute, which no longer exists in the project.
duplicated name.PNG
duplicated name.PNG (30.99 KiB) Viewed 1358 times
There is also a bug in Change Any Fact Tag where closing the plugin with <QUIT Plugin and UNDO Edits> generates an error. It is of no consequence, as the plugin is closing anyway, but it is a little untidy.
quit error.PNG
quit error.PNG (6.77 KiB) Viewed 1358 times
Mark Draper
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Change Specific Fact - Error on run

Post by tatewise »

I agree that it is more efficient to use the Change Any Fact Tag plugin to eliminate such duplicates.
However, the annoyance is that no specific Fact changes can be performed until all the duplicates have been resolved.
An associated niggle is that the Change Specific Fact plugin only reports one duplicated Fact at a time.

I am currently updating the Change Any Fact Tag plugin and will investigate the duplicate Fact name problems.
I can reproduce the error with the Plugin Store Version 3.6 but the Error when running 'Change Any Fact Tag' (20800) Attachment Version 3.6.1 does not even list both duplicate Fact names :oops:

The advice I usually give is to change the Label of the Event (e.g. Junk Event) and then everything works fine.
That advice needs to be added to my plugin Help pages.

The QUIT Plugin and UNDO Edits action is deliberate, as that is the only way I know of to roll back all the changes.
That needs to be explained in my plugin Help pages.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Change Specific Fact - Error on run

Post by Mark1834 »

It’s a design and usability issue, so there is no right or wrong way to do it, but if it were me, I would have the button do one of two thing:
  • If no changes have been made, just close the plugin.
  • If changes have been made, display a message telling the user to select Edit>Undo plugin updates from the main FH menu. It’s a couple more clicks, but it gets the user familiar with the stock method for rolling back plugin updates.
Mark Draper
Post Reply