Is Datatable Editor PHP 8.0 compatible ?

Is Datatable Editor PHP 8.0 compatible ?

Benoit87Benoit87 Posts: 8Questions: 3Answers: 1

Is Datatable Editor PHP 8.0 compatible ?

Thanks

Answers

  • allanallan Posts: 55,883Questions: 1Answers: 8,835 Site admin

    I believe so, but Colin is going to spin up a PHP 8 instance just to confirm. He'll report back here when done.

    Regards,
    Allan

  • colincolin Posts: 14,208Questions: 1Answers: 2,408

    Yep, I just installed REMI PHP 8.0.2 and all our tests ran through smoothly so it looks good as Allan predicted.

    Colin

  • imarderimarder Posts: 12Questions: 5Answers: 2

    Hello, further to this, I ran up a PHP 8.1.1 and got problems into the JSON where my DB date and date time fields default to NULL
    These are the php_error_log

    [12-Jan-2022 10:23:51 Australia/Melbourne] PHP Deprecated:  DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /Applications/XAMPP/xamppfiles/htdocs/consuls/php/lib/Editor/Format.php on line 67
    [12-Jan-2022 10:23:51 Australia/Melbourne] PHP Deprecated:  date_create_from_format(): Passing null to parameter #2 ($datetime) of type string is deprecated in /Applications/XAMPP/xamppfiles/htdocs/consuls/php/lib/Editor/Format.php on line 128
    
  • allanallan Posts: 55,883Questions: 1Answers: 8,835 Site admin

    Thanks for letting me know about that - fixed here and will be in the next Editor release, which I'll be dropping soon.

    Allan

  • kingregistrationkingregistration Posts: 3Questions: 1Answers: 0

    In version 2.0.7, you still have usage of create_function which has been removed from php8. This is in file htmlawed.php. I don't know when this file gets used, but this would error out in php8. It can easily be replaced with a proper anonymous function.

  • allanallan Posts: 55,883Questions: 1Answers: 8,835 Site admin

    Many thanks for flagging that up. I've updated to the latest version of HtmLawed which addresses this issue. It will be included in the next release of Editor, or you can use that file directly at the moment.

    Regards,
    Allan

  • LapointeLapointe Posts: 387Questions: 73Answers: 4

    htmlawed 1.2.6 return errors with php 8.1.6 :smile: Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in D:\www\dafaction\lib\HtmLawed\Htmlawed.php on line 95

  • LapointeLapointe Posts: 387Questions: 73Answers: 4

    hi all
    Htmlawed.php (and all php files) need to be modified to ensure no optional string type parameter is passed as null in some php function:
    explode, preg_replace, preg_replace_callback, ....
    example line 95, 102, 109, ....
    I do job until 3.20 AM and need to go to bed... I just activate PHP 8.1.6, do changes in a lot of php files, and then (after posting prod files) find a bug in a module (don't know where Htmlawed is called) and 2 solutions were possible... go back to php 7 or find a solution...
    Hope the production version is still stable...
    Regards
    Bob

  • allanallan Posts: 55,883Questions: 1Answers: 8,835 Site admin

    Htmlawed is called as part of the XSS protection. You could bypass it by adding ->xss(false) to the fields. Sorry you’ve run into a problem here - I will get on to this next week.

    Allan

Sign In or Register to comment.