Gazelle icon indicating copy to clipboard operation
Gazelle copied to clipboard

PHP warnings viewing user profile

Open itismadness opened this issue 7 years ago • 1 comments

PHP warnings:

Code Warning Line
include() Undefined index: torrents /sections/user/community_stats.php:8
include() Undefined index: artist /sections/user/community_stats.php:9
include() Undefined index: collages /sections/user/community_stats.php:10
include() Undefined index: requests /sections/user/community_stats.php:11
include() Undefined index: AutoloadCommStats /sections/user/community_stats.php:245

itismadness avatar Nov 14 '18 15:11 itismadness

Changing https://github.com/OPSnet/Gazelle/blob/d9920427fd09c37434a2a6634baf3dbb16339f85/sections/user/community_stats.php#L8-L11 to

$NumComments = array_key_exists('torrents', $Comments) ? $Comments['torrents'][1] : floatval('');
$NumArtistComments = array_key_exists('artist', $Comments) ? $Comments['artist'][1] : floatval('');
$NumCollageComments = array_key_exists('collages', $Comments) ? $Comments['collages'][1] : floatval('');
$NumRequestComments = array_key_exists('requests', $Comments) ? $Comments['requests'][1] : floatval('');

should take care of the first 4 warnings, if I'm not mistaken. The last warning I'm not seeing in vagrant.

oieeq avatar Nov 28 '18 16:11 oieeq