Errors with PHP7 in SVN 7153
Brought to you by:
canajun2eh,
yalnifj
Hello,
I installed php7 today. I installed thereafter phpgedview SVN 7153 and reinstalled a empty DB.(MariaDB )
I reimported therein my GEDCOM fille.
When I use phpGedView I receivle some errors on each page " non wel formed numeric value"
See attached document
My Environment:
Linux (opensuse tumbleweed)
PHP version 7.1.3, Apache 2.4.5 and MariaDB 10.1.22
Regards
Philippe
I'll look into this when I return to home, early in April. I'll probably need more detail. I'll let you know.
Hello,
Thanks for your answer.
I traced most of the problems to calls to function microtime(). Adding the parameter true solved the problem.
Another problem was in a call to a null object in includes/classes/class_stats.php / i added a test that solves the problem but not sure that it is the correct solution. I have only basic knowlegde on php.
I tested further and didn't find more problem with display and little updates.
Need still to test all the possible inserts and update.
I link here a text file with
1. the php scripts updated
2. the lines updated
Regards
Philippe
SVN 7154 implements corrections to the usage of the microtime() function by adding the "true" parameter, so that all instances of microtime() become microtime(true).
Two instances of incorrect string to array conversion in includes/classes/class_stats.php were corrected by replacing the $params='' assignment with $params=array() .
Hello,
Thanks I'll have a look to this version. I found some other error with php7.1. See the file attached
I found also two other problems that I could not solve but these are not related to PHP7.
I'll open another bug report for this.
Regards
Philippe
Philippe:
I am trying to simplify the corrections. Please try the following corrections. The attachment is a ZIP file containing replacements for functions_mediadb.php and for functions.php .
Please let me know whether these corrections work for you.
Hello,
This seems working for the creation of a new multimedia object and when updating the name of an individual
Many thanks
Philippe
These changes have been uploaded to SVN. SVN 7155
Hello;
An error occurs when calling the individual data with a shared note :
ERROR 8: A non well formed numeric value encountered
/srv/www/htdocs/gedview/includes/classes/class_gedcomrecord.php on line 461
Many thanks in advance
Philippe
The problem seems to be caused by class_note.php line 57 passing a string to the _getAllNames function in class_gedcomrecord.php. The string being passed is NOT an error.
Please try the attached replacement for file "includes/classes/class_gedcomrecord.php". If this works, I'll update SVN accordingly.
hello,
I installed the class_gedcomrecord.php but the error remains
"ERROR 8: A non well formed numeric value encountered
0 Error occurred on line 461 of file class_gedcomrecord.php in function _getAllNames
1 called from line 57 of file class_note.php in function getAllNames
2 called from line 605 of file class_gedcomrecord.php in function getFullName
3 called from line 1709 of file functions_edit.php in function add_simple_tag
4 called from line 2509 of file functions_edit.php in function create_edit_form
5 called from line 466 of file edit_interface.php
Notice: A non well formed numeric value encountered in /srv/www/htdocs/gedview/includes/classes/class_gedcomrecord.php on line 461"
Regards
Philippe
Thank you for letting me know that this quick fix failed. Too bad.
Please try the attached replacement for class_gedcomrecord.php. I changed the logic to specifically test for the $level field to be numeric. The only place where this field is NOT numeric (there's a good reason for this) is when the _getAllNames function is called from class_note.php.
Hello Gerry,
Your last fix solved the problem.
Many thanks
Philippe