sourcebans-pp icon indicating copy to clipboard operation
sourcebans-pp copied to clipboard

Edit Ban Details Fatal error: Uncaught Error: Cannot use object of type ADORecordSet_mysqli as array

Open borzaka opened this issue 5 years ago • 5 comments

What are the steps to reproduce this issue?

  1. Issue a ban on the WebPanel for 30 minutes
  2. Edit later, change to permanent and upload a demo
  3. Save changes

What happens?

PHP Fater error, a ban changes to permanent, but the demo is not saved: File not found. when trying to review. image

What were you expecting to happen?

Save changes without error, successful demo upload and being able to review (download) it.

Any logs, error output, etc.?

Fatal error: Uncaught Error: Cannot use object of type ADORecordSet_mysqli as array in /home/sourcebans/public_html/pages/admin.edit.ban.php:206 Stack trace: #0 /home/sourcebans/public_html/includes/page-builder.php(133): require_once() #1 /home/sourcebans/public_html/index.php(37): build('Edit Ban Detail...', '/admin.edit.ban...') #2 {main} thrown in /home/sourcebans/public_html/pages/admin.edit.ban.php on line 206

/var/log/apache2/error.log:

[Mon Sep 23 00:05:34.203020 2019] [php7:warn] [pid 16495] [client xxx.xxx.xxx.xxx:58312] PHP Warning:  move_uploaded_file(/home/sourcebans/public_html/demos/3a0d41a175d96149ad06f3e1711a043b): failed to open stream: Permission denied in /home/sourcebans/public_html/pages/admin.uploaddemo.php on line 43, referer: https://SERVERNAME.XX/~sourcebans/pages/admin.uploaddemo.php
[Mon Sep 23 00:05:34.203067 2019] [php7:warn] [pid 16495] [client xxx.xxx.xxx.xxx:58312] PHP Warning:  move_uploaded_file(): Unable to move '/tmp/php7quMVO' to '/home/sourcebans/public_html/demos/3a0d41a175d96149ad06f3e1711a043b' in /home/sourcebans/public_html/pages/admin.uploaddemo.php on line 43, referer: https://SERVERNAME.XX/~sourcebans/pages/admin.uploaddemo.php

Any other comments?

If I edit again this ban, and upload a demo (no other changes), it says The ban has been updated successfully, but still cannot review (download the demo). Says File not found.

The looks like successfully uploaded: image

But no files in the /demos folder which has 766 permissions.

Edit: I have successfully resolved my issue with the demo upload with chown www-data to the demos folder. But this is the correct way?

What versions of software are you using?

Operating System: Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2 (2019-08-28) x86_64 GNU/Linux (Debian 10.1) SourceBans++ Version: 1.7.0 | Git: 931 PHP Version: 7.3.4-2 MySQL Version: mariadb Ver 15.1 Distrib 10.3.17-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 Link to your project: Sorry, I don't want to post it here. Link to a phpinfo() output: I don't want to post it here.

If you need the last two info, contact me on Discord.

borzaka avatar Sep 22 '19 21:09 borzaka

The demo system has been funky in the past, so I'm not surprised if this does happen. This means we need to rewrite this portion of the system as well.

rumblefrog avatar Sep 23 '19 04:09 rumblefrog

I observe a similar problem when editing mutes: Fatal error: Uncaught Error: Cannot use object of type ADORecordSet_mysqli as array in /var/www/xxx.ru/public_html/pages/admin.edit.comms.php:152 Stack trace: #0 /var/www/xxx.ru/public_html/includes/page-builder.php(133): require_once() #1 /var/www/xxx.ru/public_html/index.php(37): build('Edit Block Deta...', '/admin.edit.com...') #2 {main} thrown in /var/www/xxx.ru/public_html/pages/admin.edit.comms.php on line 152

And a new problem. I can’t delete/unban the ban or mute.

monsterbnd avatar Sep 25 '19 10:09 monsterbnd

Hello,

That's a different error. Please create a separate issue ticket and follow the template. Thanks.

Hackmastr avatar Sep 25 '19 10:09 Hackmastr

Just to update, I'm getting this error too: image

Same thing when having edit Comms: https://github.com/sbpp/sourcebans-pp/issues/606

I'm using SourceBans++ 1.7.0 | Git: 1145.

crashzk avatar Oct 09 '21 23:10 crashzk

I've reproduced this exact same error too, upon editing a ban length to make it permanent (from a week, initially). However the ban shows the updated length at the Dashboard, anyway.

Adrianilloo avatar Mar 11 '22 01:03 Adrianilloo