Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

[SOLVED] EXCEPTION ...
 
Notifications
Clear all

[SOLVED] EXCEPTION - Class name must be a valid object or a string

2 Posts
2 Users
0 Reactions
2,583 Views
(@avris)
Posts: 8
Active Member
Topic starter
 
[#6815]

Hi,

In the logs I see:

** ERROR ** [V8.5.1] EXCEPTION **
** ERROR ** [V8.5.1] on file '/*****/view/diary.php' at line (465)
** ERROR ** [V8.5.1] cause = Class name must be a valid object or a string
** ERROR ** [V8.5.1] => #0 /*****/view/diary.php (161) -> getAllActivities()
** ERROR ** [V8.5.1] => #1 /********/view/diaryMain.php (321) -> include()

In function getAllActivities() I added a check for 0 value on refId while iterating $workList:

        foreach ($workList as $pw) {
          if ($pw->refId == 0)
                continue;
          $item=new $pw->refType($pw->refId);

Not sure this is the correct fix, but it resolved it for us.

Could you please indicate if this workaround is OK and/or provide a proper fix?

Thanks and regards,
Avri


 
Posted : 14 Jul 2020 14H39
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,

Thanks for pointing out the issue, and even more for posting a fix
We'll include some fix in V8.5.2.
Not exactly the same, we'll replace

if ($pw->refId == 0) continue;

with

if (!$pw->refType) continue;

which is a bit more accurate.

But what is strange is that you should never have a Planned Work without refType defined...
Possibily you could look for such lines in table plannedwork (line with refType null).
You can also try to execute the Concistency check on admistration form, maybe it can fix it.

Thanks


 
Posted : 15 Jul 2020 14H16
Share:

Scroll to Top