Forum

[SOLVED] EXCEPTION ...
 
Notifications
Retirer tout

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

2 Posts
2 Utilisateurs
0 Reactions
2,550 Vu
(@avris)
Posts: 8
Active Member
Début du sujet
 
[#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


 
Posté : 14/07/2020 2:39 pm
(@babynus)
Posts: 14952
Membre 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


 
Posté : 15/07/2020 2:16 pm
Share:
Retour en haut