Page 1 of 1
TextPart problem after recent upgrade
Posted: 14 Dec 2021 15:41
by JoopvB
I pick parts of place names with TextPart in this manner:
{=TextPart(%FACT.PLAC%, 4)} <in {=TextPart(%FACT.PLAC%, 1, 3, TIDY)}>
The fourth part being a name of a building, cemetery etc.
This worked great, but after the latest upgrade 7.0.9 it doesn't anymore. When used with place, part2, part3, part4 it does what it's supposed to do (separate part4). But when used with place,,,part4 it doesn't. It is ignoring the "place holder" comma's and part4 is regarded as the second part.
Please confirm this error so that I can report it to CP.
Re: TextPart problem after recent upgrade
Posted: 14 Dec 2021 16:31
by tatewise
No, I am not seeing that problem. It seems to be working correctly in FH v7.0.9.
I have literally copy & pasted your Template expression and Place names, and all seems OK.
Have you literally copy & pasted your Place names into your posting?
Does the problem affect all Place names with no spaces between commas?
Are you sure they are actually commas and not some Unicode character that looks like a comma?
Re: TextPart problem after recent upgrade
Posted: 14 Dec 2021 16:53
by JoopvB
This is a copy paste from my birth fact sentence:
{individual} is <om {=Section(%FACT.NOTE2%,1, "||")} uur> {date} {=TextIf(%FACT.AGE%="Stillborn","dood")} geboren {=TextPart(%FACT.PLAC%, 4)} <in {=TextPart(%FACT.PLAC%, 1, 3, TIDY)}> . {=Section(%FACT.NOTE2%,2, "||")}
Has been working perfectly up until the latest update.
The only thing that might be different between your test and mine, I think, is the language (in my case Dutch). I think I read somewhere in the CP changes log for 7.0.9 that they have been making changes to the language pack implementation.
To be clear, I haven't touched either the fact definition or the language pack.
Re: TextPart problem after recent upgrade
Posted: 14 Dec 2021 18:16
by tatewise
I've copy & pasted that Sentence Template and it works just fine.
I don't see how the language would affect the =TextPart() function.
As I said before, I suspect that place,,,part4 is not using comma separators but some similar-looking Unicode character.
Have you literally copy & pasted that Place name into your posting here or did you retype it?
Does the problem affect all Place names with no spaces between commas or just that one?
I cannot believe place,,,part4 is an actual Place name in your Project.
Please copy & paste an actual Place name that illustrates the problem.
Re: TextPart problem after recent upgrade
Posted: 14 Dec 2021 18:37
by JoopvB
Mike, an actual copy past:
Sassenheim, Hoofdstraat 82,, in Huize St. Bernardus
Results in:
Hij is op 4 december 1949 geboren in Sassenheim, Hoofdstraat 82, in Huize St. Bernardus.
Whereas:
Sassenheim, Hoofdstraat 82,xx, in Huize St. Bernardus
Results in:
Hij is op 4 december 1949 geboren in Huize St. Bernardus in Sassenheim, Hoofdstraat 82, xx.
Fact definition:
{individual} is <om {=Section(%FACT.NOTE2%,1, "||")} uur> {date} {=TextIf(%FACT.AGE%="Stillborn","dood")} geboren {=TextPart(%FACT.PLAC%, 4)} <in {=TextPart(%FACT.PLAC%, 1, 3, TIDY)}> . {=Section(%FACT.NOTE2%,2, "||")}
Only difference between your setup and mine (I guess) is the language.
Only difference between the old situation (identical definition, places etc.) and now is the software upgrade.
Re: TextPart problem after recent upgrade
Posted: 14 Dec 2021 19:07
by tatewise
Yes, you are correct.
If any language is chosen in Tools > Preferences > International or the Report > Options > Language tab, then the =TextPart() is upset if any comma separated place part is empty or only spaces.
I have tried several languages and they all suffer the same way.
I suspect the problem lies in the Language Plugin in the FH_GetPlaceText() function.
There is a loop through Place parts that usually strips/tidies empty or space only parts.
I am surprised that has changed its impact in FH v7.0.9 as I doubt if the Language Plugins have changed.
However, your Dutch Language Plugin has removed the if sTemp ~= "" then condition so that empty parts were retained.
Some debugging of the Language Plugin suggests that the Place name has already been 'tidied' before handing over to the FH_GetPlaceText() function, and that is perhaps what has changed in FH v7.0.9.
Re: TextPart problem after recent upgrade
Posted: 15 Dec 2021 00:41
by JoopvB
Thanks for the confirmation Mike.
I've reported it to CP.
Re: TextPart problem after recent upgrade
Posted: 15 Dec 2021 14:03
by JoopvB
Got a reply from CP. They confirm it's a language pack related problem and that it will be fixed in the next update.