willianmano / moodle-theme_moove

A Moodle Boost child theme
GNU General Public License v3.0
170 stars 155 forks source link

User constructor call failed #464

Closed AngelAyllon closed 2 months ago

AngelAyllon commented 2 months ago

Loading a category view shows the error "Exception - theme_moove\util\user::__construct(): Argument #1 ($user) must be of type ?stdClass, string given, called in [dirroot]/theme/ moove/classes/util/course.php on line 90"

The problem is in the sentence: $userutil = new user($user->id); It attempts to create a moove/util/user object when the object's constructor determines that it should pass an object and not a variable as an argument:

moodle/classes/util/user.php:

public function __construct(stdClass $user = null);

The patch for this issue is simple but there could be other calls to the user object constructor in the moove code.

Version moodle: [4.3.4+ (Build: 20240516)] Version moove: $plugin->version = 2023100903; $plugin->release = '4.3.3';

willianmano commented 2 months ago

@AngelAyllon This issue was solved on 4.4