Skip to content

"Class name must be a valid object or a string" on DashboardWidget.php::172 #2109

@swierczek

Description

@swierczek

I'm getting an error Class name must be a valid object or a string from /system/ee/ExpressionEngine/Addons/pro/Model/Dashboard/DashboardWidget.php:172 when trying to view my dashboard (/admin.php?/cp/homepage) in the CP as a non-superadmin. For some reason, it works fine as a superadmin.

I have a 3rd party add-on (Publisher) and 2 of its Widgets installed and configured on my dashboard (pending_approvals and recent_edits, though I don't believe the bug has to do with Publisher directly):

image

The issue appears to be because $addon is referenced, but is sometimes null because it's being set in the conditional.

This diff seems to fix it by using $this->_addon everywhere instead of $addon.

image

Tested on EE 6.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: AcceptedBug has been confirmed, is reproducible, and ready to work on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions