Jump to content
TNG Community

Problem switching to PHP 8.0.16


fluffy82

Recommended Posts

Ron,

Mods that still issues include the Cousins and Relate Mod.  Version you show in your list have not been published.  The Cousins mod shows errors in the TNG globallib.php when I tested this morning.

Link to comment
Share on other sites

9 hours ago, Ken Roy said:

still issues include the Cousins and Relate Mod

Ken,

Check the versions of Cousins and Relate mod I sent you via email tonight, neither of which present warnings on PHP 8.1.1 on my remote test site.  And yes, they have not been published yet. 

Link to comment
Share on other sites

  • 4 weeks later...

Ok, so I was forced to upgrade my PHP to 8.0.17 because WordPress and the plugins I use don't all support PHP 7 anymore.

I was going over the issues this brings with TNG. Some of the issues that were present using PHP 8.0.16 are gone - the search pages seem to work, for example. But the getperson.php gives errors.

These errors seem (?) to be in text added by the Regroup Person Profile mod. Here's an example:

#Add the list of siblings if they belong here in the person block
	#(The person being profiled is not in the sibling list in this case.)
	if ($rrconfig['ppSiblingsWhere'] == 'person')
		$persontext .= rrGetSiblings($personID, 'person');

	# Put the "basic" events in a table stored in $basictext.
	$basictext = $persontext . "</tbody></table>\n" . endSection("info"); #[[xyz]]
	# Subsequent person event will wind up in the "other2" section, in $othertext
	$persontext = "";
	resetEvents();  # Should clear the events we've already processed
	###Regroup Person Profile Location 6: End of insertion text
	if($rights['both']) {
		###Regroup Person Profile Location 6b: Moved custom events from here to after the LDS events.

In this small piece of code, it says:

#[[xyz]] is invalid; the problem is solved by changing it into #[xyz], but I don't know if that changes the functionality

$persontext = ""; is an invalid variable (even if it is set 5 lines above, so that's weird)

resetEvents is a syntax error, unexpected identifier --> a couple of lines down there is "setEvent", which has the same issue

if($rights .... is a syntax error, unexpected token --> also the next if() is seen as an error

 

The weird thing is that when I run the code through a PHP code checker (for 8.1) these errors don't exist, the only one popping up is a missing ")" somewhere, 2x a double semi-colon and the $persontext as above.

Should I just wait patiently until my host provides PHP 8.1, or are these issues that won't go away and need addressing?

Link to comment
Share on other sites

You probably should download and beta test TNG 13.1.2 if you want TNG PHP 8 ahd 8.1 errors fixed

Link to comment
Share on other sites

1 hour ago, Ken Roy said:

You probably should download and beta test TNG 13.1.2 if you want TNG PHP 8 ahd 8.1 errors fixed

The vanilla TNG works fine. It's the mods that cause errors at this point, so I don't think using the TNG beta will be helpful without the mods being adapted too. Unfortunately, I can pinpoint the errors, but have not the slightest clue on how to solve them.
The errors I get using 8.0.17 seem to be no errors in 8.1, so maybe I'll just wait for my host to upgrade.

Link to comment
Share on other sites

Michel KIRSCH

# are comment signs. It seems that they are badly interpreted...

Try to replace them with a double slash (//)

Michel

Link to comment
Share on other sites

Michel KIRSCH

this code : #[[xyz]]

will raise a syntax error : Parse error: syntax error, unexpected token "[" in C:\inetpub\wwwPHP\genealogie\getperson.php ...

For others, i don't see from where the problem comes...

Tested with PHP 8.1.4...

 

Link to comment
Share on other sites

2 hours ago, fluffy82 said:

It's the mods that cause errors at this point, so I don't think using the TNG beta will be helpful without the mods being adapted too

You need to identify which mod is causing the problem, if you expect the mods to get fixed. 

Link to comment
Share on other sites

Michel KIRSCH

After the semi-colon of $persontext = "";

there is a hidden sign which i can't identify...

Place your cursor after the semi-colon and push delete. There will be no difference at screen but the error will disappear

maybe a bad ftp transfer?

Link to comment
Share on other sites

Michel KIRSCH
5 minutes ago, Michel KIRSCH said:

there is a hidden sign which i can't identify..

It is a Null character (Hex 00)

Link to comment
Share on other sites

3 hours ago, fluffy82 said:

The weird thing is that when I run the code through a PHP code checker (for 8.1) these errors don't exist, the only one popping up is a missing ")" somewhere, 2x a double semi-colon and the $persontext as above.

 

3 hours ago, fluffy82 said:

#[[xyz]] is invalid; the problem is solved by changing it into #[xyz], but I don't know if that changes the functionality


Tom,
     If there is a mismatched or missing ")" somewhere, that will throw the parsing of the file off.  Also the #[[xyz]] interpretation being that PHP does special parsing of certain comments is throwing off the parsing of the file.  I assume that Robin put that in as a way to make that line unique to another line of code that is similar, but he shouldn't have special parsing values in the comments that he is not intending to be parsed in that way.

     So the first thing to do would be to make sure that all #[[ additions from the Regroup Person Profile mod get reduced to an ordinary comment, just removing the "[[" and "]]" around whatever should be satisfactory.  Then see what actual errors still remain.

Brent

Link to comment
Share on other sites

Michel KIRSCH
6 minutes ago, bhemph said:

So the first thing to do would be to make sure that all #[[

a simple espace between the '#' and the first '[' solves the problem too

Michel

Link to comment
Share on other sites

19 hours ago, Ken Roy said:

You need to identify which mod is causing the problem, if you expect the mods to get fixed. 

In the message above I said it seems to be the Regroup Person Profile mod.

Link to comment
Share on other sites

 

On 4/10/2022 at 5:57 PM, bhemph said:

So the first thing to do would be to make sure that all #[[ additions from the Regroup Person Profile mod get reduced to an ordinary comment, just removing the "[[" and "]]" around whatever should be satisfactory.  Then see what actual errors still remain.

You were right. Removing the "#[[ ]]" made the other errors disappear. I'm now going to install the other mods one by one, testing if there's any others causing trouble...

 

EDIT: all work, save one... Add Parents Children Row gives a fatal error. Not sure if Add Person row Siblings Spouses will work, as that can only be installed when the former is.

Both actually install perfectly, the error is when opening a person profile. While with the previous error it was the TNG error log that was giving me a white screen with one notification, this error is the WordPress error log telling me there is a fatal error. Contrary to the previous errors, the header loads until the name of the person and the birth/death date, but doesn't load the actual page nor the footer.

The WordPress error log says:

 

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, mysqli_result given in /var/www/vhosts/huygens-vandemoortel-ancestry.be/httpdocs/tng_11/personlib.php:1605

Line 1605 in the modified personlib says:

        $pccount = count($prntchilddata);

The variable $prntschilddata is set the line above, 1604:

$prntchilddata = getChildrenData($tree, $familyID);

 

Not sure how to solve this...

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