Jump to content
TNG Community

Warnings on some individual person information pages


torivar

Recommended Posts

Hi all,

I’m a new TNG-user, and just downloaded and installed TNG 14.0.3 on my WAMP-server (w/PHP 8.2.13, mySQL 8.2.5), using template 4.

Installation runs smoothly, so with the GEDCOM-import. 
However, and as can be seen from the enclosed screeshot, I get some warnings/errors displaying e.g. individual person information :

Warning: Trying to access array offset on value of type null in C:\wamp64\www\tng1403\personlib.php on line 417 
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in C:\wamp64\www\tng1403\personlib.php on line 417

What is strange, is that I only get this error for some individuals, not all.

The data originates from a TMG GEDCOM export

I just added a quickfix on line 417 in personlib.php : 

            //TIE quickfix
            if (!is_null($xnote)) {
                $newfact[0] = trim( $xnote['note'] );
            }
            else
                $newfact[0] ='';
            // $newfact[0] = trim( $xnote['note'] );
            // TIE

Two questions:

1) Do you see any side-effect of this fix?

2) Any ideas what has gone wrong here ? Could it be something with the source GEDCOM?

Thank you !
Rgds,
Tor

image.png

Link to comment
Share on other sites

Michel KIRSCH

Never seen this warning.
If you want to avoid it, i would prefer :

 

        $xnoteres = @tng_query( $query );
        if( tng_num_rows ($xnoteres) > 0 ) {                                        (instead of if ($xnotesres) {
            $xnote = tng_fetch_assoc( $xnoteres );
            $newfact[0] = trim( $xnote['note'] );
            $newfact[1] = $matches[1];
            getCitations( $matches[1] );
        }

So you're sure that if there is no result for the query, the $xnoteres will not be exploited...

Michel

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...