Extension "backup" not working with PHP 8.0

05.01.2022 13:42
#1
HinzBerlin
Joomshopping forum user no avatar
Name: Uwe
30.06.2017
Posts: 18
Quote
Extension "backup" not working with PHP 8.0

Hello,
just tried to backup shop data with the backup module:

First Message: "Array and string offset access syntax with curly braces is deprecated"
changed line 410 from »if($table_name{0} === '_')« to »if($table_name[0] === '_')» => seems to be oK
but
Tried to create new backup, db only => Error message: "0 in_array(): Argument #2 ($haystack) must be of type array, null given"

With 7.4.27 it's working well.

joomla 3.10.4
joomshopping 4.18.7
JoomShopping - Backup 1.1.10
php 8.0.14

Regards
Uwe

attached some content from apache logfile:
[proxy_fcgi:error] [pid 346:tid 140290039985920] [client ::1:46298] AH01071: Got error 'PHP message: PHP Warning: Undefined array key "files" in /var/www/joomla/administrator/components/com_jshopping/models/backup.php on line 206', referer: http://dev.hinz.de:8080/administrator/index.php?option=com_jshopping&view=backup&layout=edit&controller=backup
[proxy_fcgi:error] [pid 25859:tid 140624653174528] [client ::1:46430] AH01071: Got error 'PHP message: PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/joomla/administrator/components/com_jshopping/models/backup.php on line 248


Joomla: 3.10.4
JoomShopping: 4.18.7
PHP: 8.0.14
MySQL: 10.3.32-MariaDB
Website Url: internal dev-machine

Last change: 05.01.2022 14:33
 
06.01.2022 12:01
#2
HinzBerlin
Joomshopping forum user no avatar
Name: Uwe
30.06.2017
Posts: 18
Quote
Aw: Extension "backup" not working with PHP 8.0

Changing Line 206 of backup.php
from $this->files = $data['files'];
to $this->files = $data['files'] ?? array();
seems to solve this issue.
Uwe


Last change: 06.01.2022 12:01
 
11.01.2022 18:13
#3
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25854
Quote
Aw: Extension "backup" not working with PHP 8.0

Thank you.
Fixed in Backup 1.1.11

 
11.05.2022 09:36
#4
HinzBerlin
Joomshopping forum user no avatar
Name: Uwe
30.06.2017
Posts: 18
Quote
Aw: Extension "backup" STILL! not working with PHP 8.0

Hello Support Team,
unfortunately not completely fixed in 1.1.11,
there ist still the error on line 413: if($table_name{0} === '_')

I just updated and ran into the same error
[Wed May 11 09:06:30.047204 2022] [proxy_fcgi:error] [pid 348:tid 139980005426944] [client ::1:45690] AH01071: Got error 'PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /var/www/joomla/administrator/components/com_jshopping/models/backup.php on line 413', referer: http://my.devserver.de:8080/administrator/index.php?option=com_jshopping

Uwe

 
11.05.2022 11:05
#5
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25854
Quote
Aw: Extension "backup" not working with PHP 8.0

Fixed in
Backup 1.1.12

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.