Jump to content
TNG Community

Citation Master Mod v9 (rc1) - PHP-8 / Source Thumbnails / Context-sensitive Formatting


Bill Herndon

Recommended Posts

I have posted the first release candidate (rc1) of Citation Master v9 on the TNG Wiki.  

This is a major update that adds two new features and incorporates PHP-8 compatibility:

  • Source/Citation thumbnails for all sources that have an attached media file are displayed in the citation area of individuals and families.  (This feature can be enabled/disabled in Mod Manager parameters.)
  • Format specifications now support the ability to have different instruction sets for source displays and citations displays.  The idea here is to be able to create "short format" citations as one would find in scholarly publications, but the feature allows for any complexity for the formatting.

The Citation Master Wiki page has details and examples of the new features and Lindell-Herndon Genealogy is running the release candidate and has additional examples.

The release candidate can be downloaded here.

This update was developed against TNG 13.0.4 and may be compatible with, but has not been tested against, earlier versions from TNG 13.0 forward. 

Comments, bugs, and suggestions for additional features are very welcome.

Bill Herndon

Lindell-Herndon Genealogy

Link to comment
Share on other sites

Hi Bill,

You might have taken me up on my offer to test before you posted your zip file :)

When I go to Edit Options I get an Error

1. Mon 13 Sep 2021 10:54:29 PM | edit parameters | Citation Master v13.0.0.9-rc1 | errors | TNGadm
    * editing D:/wamp64/www/tng/roy_mods/cite_master_v13.0.0.9-rc1.cfg
    * target file roy_extensions/citem_options.php parameter missing: $citem_show_thumbnails

Maybe the previous citem_options.php did not get removed from my extensions folder when I uninstalled your previous version

Link to comment
Share on other sites

Ken,

That's exactly the problem--and happened exactly the same way in my test environment.  The Mod Manager doesn't seem to be removing the previous version from the extensions folder.

Not sure if that's a Mod Manager bug or not.  Regardless, I'd copy the previous version to another location prior to installation.  And thanks for the post.  I'd intended to update the installation instructions on the Wiki article but forgot.

Bill Herndon

Link to comment
Share on other sites

Bill,

Not sure what happened, but I uninstalled and re-installed and then was able to Edit Option. 

1 hour ago, Bill Herndon said:

The Mod Manager doesn't seem to be removing the previous version from the extensions folder.

Not sure if that's a Mod Manager bug or not.

do you have a protection flag on the copyfile.  I did not look.

I did have that file open in Notepad++ so maybe Windows 10 protected it  and did not allow it to get overlaid

Link to comment
Share on other sites

Ken,

I thought of the copy protection flag as well, and removed it prior to trying my own upgrade (local).  Having said that, I should check to see how it went out in the package.

k/r

Bill Herndon

Link to comment
Share on other sites

You do have a section that uses %fileexists at line 924 which if I am not mistaken is what the protection flag is supposed to do.

Will look at this closer tomorrow morning when I am not so tired  and my eyes are working better

Link to comment
Share on other sites

I have installed Citation Master Mod v9 (rc1) and it works EXCEPT it will not display a thumbnail of the document attached to the source.   Not sure it I am doing something in error, missed an instruction, or what.  Any advice would be most appreciated.

 

Marc Irish

Link to comment
Share on other sites

Marc,

I'm using some function calls from TNG (globallib.php) to make this work.  So here are some things to check:

1) In: Administration -> Mod Manager -> Citation Master -> Installed [Options] -> Edit Options... is the option $citem_show_thumbnails set to true?

If not, set it true and save the preference.  If the option doesn't appear at all then the old citem_options.php file is probably still in the extensions directory.  (Ken Roy and I have seen this happen, and it's probably due to a mistake I may have made in my configuration file.  To fix:  go to you TNG extensions folder and move you're old citem_options.php to another location to preserve it.  Then de-install and re-install Citation Master.

2) The source for which you want the thumbnail displayed in a citation (they only get shown in citations currently) must:

  • Have an image in the Documents or Photos media collections (not sure about the other collections...I happen to use documents)
  • Have a thumbnail already generated
  • Be linked to the source from the Media entry (in administration: Media >> Edit Existing Media) ...
  • ... and be flagged as the default image for that source

Hopefully this will get the feature working for you.

k/r

Bill Herndon

Link to comment
Share on other sites

Bill,

2 hours ago, Bill Herndon said:

If the option doesn't appear at all then the old citem_options.php file is probably still in the extensions directory.  (Ken Roy and I have seen this happen, and it's probably due to a mistake I may have made in my configuration file. 

Your mod cfg file has

%fileexists:$extspath/citem_options.php:skip%
%copyfile2:~cite_master/etc/citem_options.php:$extspath/citem_options.php%
%label:skip%

I am not sure what the Mod Manager does when uninstalling the mod in that case.  In TNG v12, the Protect flag was added to the allow settings or options type of files to remain or be preserved across mod upgrades.  Of course if you add new options you need to provide instructions on how to replace the existing settings or options file

Quote

Protected flag

~ (the tilde) is used in %copyfile% commands to "protect" a file, that is, to prevent the Mod Manager from

  1. Removing the file when uninstalling a mod, and from
  2. Overwriting the file if it exists when a new version of the mod tries to install it.

The intent is to allow mods to share files, or to leave a file in place so settings in the file are preserved when a mod is uninstalled and later reinstalled (for example, for an upgrade).

I am not sure what happens, if you coded your cfg file with the %fileexists conditional processing.

Link to comment
Share on other sites

Bill,

2 hours ago, Ken Roy said:

am not sure what happens, if you coded your cfg file with the %fileexists conditional processing.

Thinking about this some more, I strongly suspect that the way you coded your %fileexists in the cfg file behaves the same way as the protect flag since that particular conditional was added in TNG v12 to support mods that depend on other mod files.

Since your mod does not depend on other mods, I would recommend that you change your cfg file to use the Protect flag so that you are aware of the need to provide instructions on how to replace your options file if you add new options.

Link to comment
Share on other sites

5 hours ago, Bill Herndon said:

Marc,

I'm using some function calls from TNG (globallib.php) to make this work.  So here are some things to check:

1) In: Administration -> Mod Manager -> Citation Master -> Installed [Options] -> Edit Options... is the option $citem_show_thumbnails set to true?

If not, set it true and save the preference.  If the option doesn't appear at all then the old citem_options.php file is probably still in the extensions directory.  (Ken Roy and I have seen this happen, and it's probably due to a mistake I may have made in my configuration file.  To fix:  go to you TNG extensions folder and move you're old citem_options.php to another location to preserve it.  Then de-install and re-install Citation Master.

2) The source for which you want the thumbnail displayed in a citation (they only get shown in citations currently) must:

  • Have an image in the Documents or Photos media collections (not sure about the other collections...I happen to use documents)
  • Have a thumbnail already generated
  • Be linked to the source from the Media entry (in administration: Media >> Edit Existing Media) ...
  • ... and be flagged as the default image for that source

Hopefully this will get the feature working for you.

k/r

Bill Herndon

Bill,

 

Flagging the media as Default for the Source worked!

 

marc

Link to comment
Share on other sites

I have posted the 2nd release candidate (rc2) of Citation Master V9 to the TNG Wiki.  This RC has more PHP-8 fixes, formatting updates for the 'thumbnail' feature (w/CSS that can be changed by the user), and removal of the option protection flag for 'show thumbnails' (ensures that the old citem_options.php is removed on de-install).

- Bill Herndon

Lindell-Herndon Genealogy

Link to comment
Share on other sites

Bill,

You should have mentioned that you changed the default file name that is being loaded.  I initially got on my WampServer running PHP 7.4 since I am still fighting the technology changes in MediaWiki and Windows 10 Pro

Quote

[17-Sep-2021 12:27:19 UTC] PHP Warning: include(): Failed opening 'mods/cite_master/config/citem_config_v9_test.php' for inclusion (include_path='.;C:\php\pear') in D:\wamp64\www\tng\roy_extensions\citem_lib_citation.php on line 110

Source / citations on getperson.php page were then only shown with S(nnnn)

After I used Edit Option to change the location for my renamed mods folder, I then got the Source Titles.

 

 

 

Link to comment
Share on other sites

Well evidently something  else changed because I am also getting the following error

Quote

[17-Sep-2021 12:27:19 UTC] PHP Warning: include(): Failed opening 'mods/cite_master/config/citem_config_v9_test.php' for inclusion (include_path='.;C:\php\pear') in D:\wamp64\www\tng\roy_extensions\citem_lib_citation.php on line 110

Sounds like you also are not allowing for users to rename the TNG mods and extensions folders.

Link to comment
Share on other sites

Ken,

No...that shouldn't be the case.  The configuration file loaded is set in the options, and you may use whatever enclosing folder--relative to the TNG root--you want to use.  Having said that, the initial value is set explicitly to the folder 'mods/config' as the default value for the RC because that is where the feature test configuration is located.

Users may rename mods or extensions, and I haven't changed anything to do with loading configuration files or libraries in quite some number of major releases.

k/r

Bill Herndon

Link to comment
Share on other sites

Well Bill,

You changed the file name in the extensions/citem_options.php: $citem_config_path in the Edit Option to

mods/cite_master/config/citem_config_v9_test.php

I was not expecting that.   

I am fighting technology changes on too many fronts at the moment. 

  • Can no longer open Excel file because of McAfee live scanning. 
  • Can not get MediaWiki to work correctly on Windows 10 Pro (actually it no longer opens the Main Page)
  • Can not get Windows 10 Pro to complete its updates

 

 

Link to comment
Share on other sites

Bill,

Best I can tell my ghost problem was caused by the

9 hours ago, Bill Herndon said:

removal of the option protection flag

I have adjusted my private mod that sets my Citation Master option settings to now include setting the $citem_config_path

Sorry about reporting a ghost problem.  It's heck getting old and not thinking clearly when over tired.

I do have a question though - how are you triggering the following PHP error log entry

Quote

[17-Sep-2021 20:32:15 UTC] New format spec loaded.

 

Link to comment
Share on other sites

Bill,

Sorry but the PHP 8 warning that I have been reporting all along on my site is still not fixed

Quote
[17-Sep-2021 16:07:43 America/New_York] PHP Warning: Undefined array key "TYPE" in /home/royboucher/www/tng13beta/tng/extensions/citem_lib_citation.php on line 804
 

Code at line 804 in your original code

  $srcType  = $citeData[$citem_type_tag]['info'];

 

Link to comment
Share on other sites

Ken... So I have a guess as to what's going on with your system, but I can't replicste the error at line 804 in my test environment. 

So...Citation Master depends on all sources having a TNG custom event that defines the source type--types like "book", "newspaper", "census", etc...  Different personal genealogy programs may export this field differently, and I have to make a guess here for Citation Master's options.  I use the GEDCOM tag "TYPE" as the default because that's what Reunion uses.

But what if there was a source record that didn't have this custom event defined...at all?  Wouldn't happen on my system where all sources that get imported have a type, but someone who does all their work in TNG?  They might have this issue, and apparently so do you.  I suspect there is at least one source record in your TNG database that has no custom event defined for the source type.  Now, CM will continue to function, but PHP-8 still outputs the warning. 

I'm going to try a fix for RC3, and we'll see if it works.

Bill Herndon

Lindell-Herndon Genealogy

Link to comment
Share on other sites

Hi Bill,

That is not a valid assumption.  Source / citations can be tied to a person in PAF and to standard events in TNG which are not in the custom events table.  I still  import all my data from PAF

Sorry I do not know how to debug web type of applications.  I added the following echo after line 804 in the extensions citem_lib_citation.php on my WampServer

  echo "CiteData is $citeData <br />";
  echo "Citem Type Tag used as srcType is $citeData[$citem_type_tag]['info'] <br />";

it echoes the following

Quote

CiteData is Array
Citem Type Tag used as srcType is ['info']
CiteData is Array
Citem Type Tag used as srcType is ['info']

Sorry, I do not know how to process arrays correctly.  I am still very much an IBM assembler programmer or bit twiddler

Link to comment
Share on other sites

Bill,

As I have offered before you are welcomed to debug on my test sandbox.  I think I sent you the credentials via email previously.

Link to comment
Share on other sites

Well TYPE does not exist, if you look at the sources on Dad's page 

S1 - has

Title 	Birth Certificate 
Source ID 	S1  	Edit
Example 	Birth Certificate. 

S33 - has

Title 	Drouin Collection, Early U.S. French Catholic Church Records, 1695-1954 (Ancestry 
Author 	Gabriel Drouin, compiler 
Publisher 	Drouin Collection, Montreal, Québec, Canada: Institut Généalogique Drouin 
Source ID 	S33  	Edit
Example 	Gabriel Drouin, compiler. Drouin Collection, Early U.S. French Catholic Church Records, 1695-1954 (Ancestry. Drouin Collection, Montreal, Québec, Canada: Institut Généalogique Drouin. 

I have been using PAF for the last 40 years.  Even though it is no longer supported, it is still the fastest data entry program.

Let me know if you want a GEDCOM from PAF.  I know nothing about MacIntosh nor Reunion

Edited to add

GEDCOM source S1

0 @S1@ SOUR
1 TITL Birth Certificate

Birth event in GEDCOM has

1 BIRT
2 DATE 13 Jun 1909
2 PLAC Frenchville, Aroostook County, Maine, USA
2 SOUR @S1@
3 PAGE State of Maine Vital Records
3 NOTE Birth record through deposition on 16 Sep 1925.  Could be a reconstruction of town records de
4 CONC stroyed by fire? or is it because when Dad needed a birth certificate, they were not able t
4 CONC o find his record and no one remember it had been recorded as Leon?

So as you can see there is no TYPE

Link to comment
Share on other sites

9 minutes ago, Ken Roy said:

That is not a valid assumption.  Source / citations can be tied to a person in PAF and to standard events in TNG which are not in the custom events table.  I still  import all my data from PAF

Ken... I was quite clear in stating that it was a guess...not a statement of fact nor an assumption.  But what are *not* guesses or assumptions with respect to Citation Master are the following:

  • Every source in a TNG database, regardless of what TNG event it is tied to, must contain a custom event that defines the source type if that source is going to be formatted with any instruction set other than the instruction set identified by the "_default" reserved word.
  • In order to locate those custom events, the option $citem_type_tag contains the GEDCOM tag that Citation Master uses to identify a source type, which in turn helps to locate the instruction set to be used.

I was speculating on the available evidence...the information you gave indicating that key 'TYPE', the default from Citation Master's options, was not found.  The only way that tag wouldn't be found is if either 1) The GEDCOM tag 'TYPE' isn't used by PAF for identifying source types in export files, or 2) There exists a source that didn't have that custom event.  I can't make the explanation any clearer, and I'm sorry you feel that it's necessary to disagree...but I'm doing my best to solve your problem.

Bill Herndon

Lindell-Herndon Genealogy

Link to comment
Share on other sites

Bill,

I edited the previous post and added the GEDCOM file portions.  There is no TYPE used any place.

Sounds to me like you are not initializing the default TYPE any place to eliminate the PHP 8 warning.  It appears to format correctly on the getperson.php page.  Just generating a PHP 8 warning error.

Link to comment
Share on other sites

  • 2 weeks later...
Bill Herndon

Ken,

Reviewing your GEDCOM, it appears that either:

1) PAF either doesn't support different source types

2) PAF does support source types but doesn't create a GEDCOM tag that represents the type on export

3) PAF does support source types, but you're not using them

What that means for Citation Master is that the Mod always uses the "_default" formatting instructions since it cannot find a GEDCOM tag (a custom event) that represents the source type.  The PHP-8 error is due to the fact that the custom event for the source type is missing in your sources.  That's not a problem for Citation Master--it was designed from  the beginning to handle this situation, but it does cause the PHP error.  I have a fix in RC3 to cover this.

k/r

Bill Herndon

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...