Page 1 of 1

problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 12:16 am
by jps
Hi everyone
I'm kindly requesting some help to the field
I'm struggling since 4 days with a new meteotemplate site
I've duplicate most of what I did with another site but unfortunately I've some persisting issue

precipitation analysis is broken:
https://paloux.meteo-triadou.fr/templat ... totals.php

report monthly are infinite loop when I try a summary/synthesys
https://paloux.meteo-triadou.fr/templat ... ate=2023/3

the yearly report is giving a white page:
https://paloux.meteo-triadou.fr/templat ... lector.php


I really don't understand what is wrong here. I've reinstalled everything from scratch

any idea are welcome :)

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 1:05 am
by FSC830
In PHP 8.x some commands and functions changed.
The pages are not modified for PHP 8.x, thats, why they are not running properly.
There are a lot of modified pages for PHP 8.x here in forum, see i.e. here.

Regards

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 7:08 am
by jps
Hi FSC

Thanks for the help

Of course I know the 8.1 php issue

I ve already managed this issue on my second meteotemplate website which is here
HTTPS://meteo-triadou.fr

Here, what I did was to apply the same modifications but it’s look like I missed one thing

Maybe something is wrong with the database

I m not able to find the reason

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 7:43 am
by FSC830
Hi,
even the second site throws a lot of errors, so you do not use the modified files there. ;)
I did not look into the "rainBlock" yet, but header and functions.php for 8.1. you will find at least in one of the PHP8 archives.
You can see the errors if you add a "?errors" (without the quotation marks) at the end of the URL.

In the next days I will collect the files modified so far and create an archive bundle for download.
This will not contain all possible blocks/plugins, if you look at my site, you will see what is already running in PHP8.x.

Regards

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 8:30 am
by jps
Hey,

again thanks for your help

you are certainly right about the error on the "good" site also. I'm pretty sure I've applied all the packages from you and davidela for this one

anyway, I still don't understand why the new site is not working for some page where the old one is working well

let's focus on this one for instance

working
https://meteo-triadou.fr/template/plugi ... totals.php

not working
https://paloux.meteo-triadou.fr/templat ... totals.php

by not working I mean, their is no graph/table shown

cheers

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 9:00 am
by jps
hi again FSC

I'm now completely lost in my investigation

this one was previously working with your site, and now I've the same behavior than with my faulty site

go here
http://gross-umstadt-wetter.de/pages/st ... ate=2022/3
and click on the icon to the right "Summary"
it turning in a never end loop for me

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 9:14 am
by FSC830
Hi,
thanks for pointing me to this issue. :) Yes, may I did not find all issues with PHP 8.x and I confess, I did nevr look into this page :oops: .

Will look in the afternoon. But graphics are a bit strange, there are more graphic pages which do not work at my VMs, neither in PHP 7.4 nor in 8.x. But the pages do not give any error output. :cry:
So its bad to find, where the code needs to be modified.

Regards

Edit: You mean the summary icon at the **left** ???

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 9:17 am
by jps
I've the feeling that I've generated this same issue on your site too

I don't know how, but it was working at the first try on your site

and now it's not working anymore...

I'm really sorry if I did something wrong on your site

it's look like, something is added somewhere (cache ?) and boom

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 9:20 am
by FSC830
Yes, may be. I found an similiar issue in forecast, where wrong cache data causes the second call to fail.
But this issue (if so) is easy to fix, dont worry about that :D .

DId you see my edt in previuos post? The summary icon is at the left, or is there any other page you have an error?

Regards

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 9:20 am
by jps
what I can't understand is why it is working on my second site
https://meteo-triadou.fr/template/pages ... ate=2023/3
becoming crazy now :)

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 9:22 am
by jps
yes,

This is the summary icon at the left, I'm pretty sure it was working for your site during my initial call/test

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 9:29 am
by FSC830
Are you running same PHP version at both sites?
Just checked in my 7.4 VM, the summary works, at 8.x it gave an "invalid date" error.
I did found an similar issue i.e. at this page (fixed in the meantime).

In PHP 8 some methods for calculating are modified, so the v7.x syntax provides an wrong outcome, causing such endless spinners.
Need to leave for now, but will take a look into it later.
You fill find an update if I fixed it (may not today 8-) ).

Regards

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 9:39 am
by jps
yes same PHP version

looks like I've found the errors:

the normal setting was missing in my config.php file
$areaNormalsTUnits = 'C';
$areaNormalsT = '7.6;8.3;11.4;14.0;17.8;21.8;24.5;24.2;20.2;16.4;11.5;8.2';
$areaNormalsRUnits = 'mm';
$areaNormalsR = '59.1;39.9;45.3;58.0;48.7;36.9;20.0;40.1;88.3;92.5;84.4;61.1';

now: the summary icon works
and also the precipitation analysis

my gosh, what a long troubleshooting (4 days)
now I've to find a way to import 5 years of meteohub data to my meteobridge... another bug

let's talk latter

and thanks for the ?errors &errors trick, I was missing this one

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 10:46 am
by jps
so previous prb is solved for me:
summary: you need to feed the normals in config.php

by browsing your website I've seen your climateIndices.php is working much better than mine: we see some graph

there is no graph at all with my website

https://meteo-triadou.fr/template/pages ... ndices.php

of course, I've updated this php too like Davidela said

but no graph for me

cheers

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 4:04 pm
by FSC830
No, that was not my problem, the values for "normals" are set.
The issue here was that there is a typo in file reportMonthlySummary.php.
In line 155 a "m" was missing, the correct line is:

Code: Select all

$data['monthlyMinTDate'] = array();
And as you can see, there are still no graphics :cry: , and here I am a bit lost, the graphics do not even work in my 7.4 installation.
To be honest, I did never used the reports in the past years. I just started to convert my pages because my provider have forced me to switch to PHP 8. Currently I am running PHP 8.2 at my site.
From 8.1 to 8.2 again some changes are mandatory (or at least recommended), so I modified all my pages already for v8.2.
"All my pages" means, all issues I found so far. :D As you proved, I did not found all yet. ;)

Regards

Edit: The typo in line 155 exists already in the origin MT v18 file, but this is one of the changed behaviours, that PHP 8.x handles errors in a different way than v7.x.

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 6:07 pm
by jps
Excellent

thanks you for the typo

I'm still struggling why I've no graph for the climateindice not showing graph

https://meteo-triadou.fr/template/pages ... ndices.php

cheers

Re: problem with a new site (PHP 8.1)

Posted: Sat Mar 18, 2023 8:32 pm
by FSC830
Vice versa at my site, there are graphs at the climate pages, but not a single graph at the reporting pages, except the overall graph.
I am looking for that since the last week, but currently without an idea whats the problem with the graphs.

Regards

Re: problem with a new site (PHP 8.1)

Posted: Sun Mar 19, 2023 1:21 pm
by jps
Ok I've found this graph issue I have with
https://paloux.meteo-triadou.fr/templat ... ndices.php

it's about the language translation : for french I've the graph broken

working on it, should be easy to fix

cheers

Re: problem with a new site (PHP 8.1)

Posted: Sun Mar 19, 2023 2:19 pm
by jps
Those troubleshooting session with PHP 8.1 remember me a monty python movie where the knight are cutting their bodies
:) :) :)

Re: problem with a new site (PHP 8.1)

Posted: Sun Mar 19, 2023 6:19 pm
by FSC830
:shock: :lol: :lol:
You are so right, same issue with German translation. :roll:
Switched to English and graphs appearing.
Will take a look at that later.

Never did assume translation as cause here, thanks for reporting. :D

Regards

Re: problem with a new site (PHP 8.1)

Posted: Sun Apr 30, 2023 9:11 pm
by milesb
I have everything I want working now that I've had to update to PHP 8.x

One issue that I've found, that will likely be an ongoing nuisance, is that I cannot edit the database entries, via Control Panel > Database > edit data, or if I choose Bulk Database Editing > Check and Fix Rain.

I had an outlier data point that I tried to edit. Found the entry, made the change, and it appeared to have changed the entry. F5 to refresh the screen, and no change had occurred, the outlier data point was still there.

If I choose Check and Fix Rain, it opens the popup, but never completes, or appears to fix the carryover rain at 00:00:00.

If I use phpmyadmin.php when logged into my hosting site, I was able to edit the data, but it is not as easy to navigate as the database editor in MT.