* Search and Replace plug-in error

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.
Post Reply
User avatar
Robert Jacobs
Famous
Posts: 140
Joined: 21 Mar 2015 18:03
Family Historian: V7
Location: Ellensburg, Washington, U.S.A.
Contact:

Search and Replace plug-in error

Post by Robert Jacobs »

I've used the Search and Replace plugin before without problems, but now when I attempt to invoke it I get this error:

[string "C:\ProgramData\Calico Pie\Family Historian\PL..."4818:attempt to concantenate a nil value (local 'strType') No changes have been made to data records.

The only recent change I can recollect which might be relevant is the movement of my FH7 data from D:\docs\FH7 to OneDrive. None of the files in C:\ProgramData\Calico Pie\Family Historian were moved. My other plugins are working correctly.

Advice will be appreciated.
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace plug-in error

Post by tatewise »

Sorry about that. I'm not sure what has caused it. Possibly in moving to OneDrive some data has been upset.

I can not see how to reproduce those symptoms without some form of corruption.

I suggest you use Windows File Explorer and navigate to the <project-name>.fh_data folder within the <project-name> folder.
There should be a Plugin Data folder where the Search and Replace.dat file can be deleted.
That will reset the plugin to default values.

So the full path will be something like:
...\OneDrive\...\Family Historian Projects\<project-name>\<project-name>.fh_data\Plugin Data\Search and Replace.dat
where <project-name> is the name of the current Project.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Robert Jacobs
Famous
Posts: 140
Joined: 21 Mar 2015 18:03
Family Historian: V7
Location: Ellensburg, Washington, U.S.A.
Contact:

Re: Search and Replace plug-in error

Post by Robert Jacobs »

Thank you, Mike. That did the trick.

It appears that FH7 (or perhaps OneDrive) mirrors the Search and Replace.Dat file to c:\ProgramData\Calico Pie\Family Historian\Plugin Data when it writes the file to the project folder on OneDrive.

Judging by the file times and dates it appears that the same thing is happening with ExportGedcom File.Dat

Is that the normal behavior?
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Search and Replace plug-in error

Post by Mark1834 »

It won’t be FH or OneDrive that is duplicating the settings file, as project and system level files are completely independent of each other.

The plugins must be written that way deliberately (perhaps new projects inherit the system settings as a default?).
Mark Draper
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace plug-in error

Post by tatewise »

Just because two files have the same name, it does not follow that they have the same contents.

The Plugin Data folder in C:\ProgramData\Calico Pie\Family Historian\ holds global settings, whereas the Plugin Data folder in each Project holds local Project settings. c.f. The Fact Types folder.

Many of my plugins have both global and local Project settings so a .dat file with the plugin filename exists in both those locations but with different contents.

For the Search and Replace plugin, the global settings are mostly Presets associated with the lower left Manage Presets pane that can be transferred between Projects and saved independently from Projects.
See the Help & Advice page Search and Replace Manage Presets.

The next version of the Export Gedcom File plugin will have the option to use global settings or local Project settings.
See Export Gedcom File plugin new features (19799).
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Jean001
Famous
Posts: 129
Joined: 03 Mar 2021 11:49
Family Historian: V7

Re: Search and Replace plug-in error

Post by Jean001 »

This evening I have experienced the same error message. Deleting the Search and Replace.dat file, as explained above, solved the problem.

I was working within FH using queries, creating a report, and updating some records. Nothing out of the ordinary.
Jean
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace plug-in error

Post by tatewise »

Sorry about that Jean.
Can you please explain exactly what criteria you were entering into the Search and Replace plugin?
In particular, what was selected in the Search Scope pane at the top?

Were you selecting an entire record type such as Family Records (FAM) or Source Records (SOUR)?
Or were you selecting specific facts such as Baptism (INDI.BAPM) or Marriage (FAM.MARR)?

Was it by any chance a custom fact with a name that includes parentheses like An (ODD) Fact?

Did you use the Select Records button to select a subset of records?

Please try the attached Search and Replace Plugin Version 3.5.1 Date 01 May 2022 that displays some diagnostic details in the Search Scope pane if the fault occurs again. It will say Unknown followed by some details.
A screenshot of that diagnostic information would be useful.
Last edited by tatewise on 03 May 2022 15:13, edited 1 time in total.
Reason: Attachment deleted as later version is in the Plugin Store.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Jean001
Famous
Posts: 129
Joined: 03 Mar 2021 11:49
Family Historian: V7

Re: Search and Replace plug-in error

Post by Jean001 »

Thank you, Mike.

I was selecting a specific custom Family Fact. There was no problem when using 'Family Records (FAM)'.

Yes, the fact name does contain parentheses.

Did you use the Select Records button to select a subset of records?
Never got to that, just selecting the appropriate fact brings up the following error message:

[string "C:\ProgramData\Calico Pie\Family Historian\..."]:4818: attempt to concatenate local 'strType' (a nil value)
stack traceback:
[string "C:\ProgramData\Calico Pie\Family Historian\..."]:4818: in function 'setScopeMode'
[string "C:\ProgramData\Calico Pie\Family Historian\..."]:4983: in function <[string "C:\ProgramData\Calico Pie\Family Historian\..."]:4979>
(tail call): ?
[C]: in function 'MainLoop'
[string "C:\ProgramData\Calico Pie\Family Historian\..."]:2467: in function '?'
[string "C:\ProgramData\Calico Pie\Family Historian\..."]:5250: in function 'GUI_MainDialogue'
[string "C:\ProgramData\Calico Pie\Family Historian\..."]:5266: in main chunk

After closing the plugin and re-running it, the error message is shown:

[string "C:\ProgramData\Calico Pie\Family Historian\..."]:4818:attempt to concatenate local 'strType' (a nil value). No changes have been made to data records.

Deleting the Search and Replace.dat file enables the plugin to run.

Screenshot attached using your diagnostic S&R plugin.
Attachments
Screenshot.PNG
Screenshot.PNG (33.1 KiB) Viewed 1271 times
Jean
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace plug-in error

Post by tatewise »

Thanks Jean. That confirms my diagnosis.
The plugin was meant to find the trailing parentheses and extract the data reference: FAM.EVEN-CHILD_BORN_F
But the extra parentheses (f) confused it and prevented it from detecting that Family (FAM) records were involved.
The fix is quite simple and will be in the next published version of the plugin, probably next week.

The fixed prototype Search and Replace Plugin Version 3.5.2 Date 01 May 2022 is attached for you to try.
Last edited by tatewise on 03 May 2022 15:14, edited 1 time in total.
Reason: Attachment deleted as later version is in the Plugin Store.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Jean001
Famous
Posts: 129
Joined: 03 Mar 2021 11:49
Family Historian: V7

Re: Search and Replace plug-in error

Post by Jean001 »

Thank you again, Mike; that has solved the problem perfectly.

Apologies from me to you for causing it!
Jean
Post Reply