Forum

[SOLVED] count(): P...
 
Notifications
Retirer tout

[SOLVED] count(): Parameter must be an array or an object that implements Countable

3 Posts
2 Utilisateurs
0 Reactions
3,737 Vu
(@ma_bou)
Posts: 24
Trusted Member
Début du sujet
 
[#6838]

Hello,

I've stumbled upon the error specified in the subjet when I first tried to copy a project after updating to the latest version (8.5.2)

Here's what the log says:

2020-07-23 06:40:01.564 ----- DEBUG ----- =>/tool/projeqtor.php at line 1634 calling debugPrintTraceStack()
2020-07-23 06:40:01.564 ----- DEBUG ----- => calling projeqtorAutoload()
2020-07-23 06:40:01.564 ----- DEBUG ----- => calling spl_autoload_call()
2020-07-23 06:40:01.564 ----- DEBUG ----- => /model/persistence/SqlList.php at line 55 calling property_exists()
2020-07-23 06:40:01.564 ----- DEBUG ----- =>/model/persistence/SqlElement.php at line 2160 calling SqlList:getList()
2020-07-23 06:40:01.564 ----- DEBUG ----- => /model/persistence/SqlElement.php at line 997 calling SqlElement:copySqlElementTo()
2020-07-23 06:40:01.564 ----- DEBUG ----- => /model/ProjectMain.php at line 1289 calling SqlElement:copyTo()
2020-07-23 06:40:01.565 ----- DEBUG ----- =>/tool/copyProjectTo.php at line 129 calling ProjectMain:copyTo()
2020-07-23 06:40:01.565 ----- DEBUG ----- WARNING : SqlElement::fetchList() called for not valid class 'ProjectPlanningMode'
2020-07-23 06:40:01.565 ** ERROR ** [V8.5.2] ERROR **
2020-07-23 06:40:01.565
** ERROR ** [V8.5.2] on file '/model/persistence/SqlElement.php' at line (2161)
2020-07-23 06:40:01.565
** ERROR ***** [V8.5.2] cause = count(): Parameter must be an array or an object that implements Countable

Thanks in advance for your help

Edit: I've tried to copy a single element without any problem.


 
Posté : 23/07/2020 2:49 pm
(@babynus)
Posts: 14952
Membre Admin
 

Hi,

Issue confirmed.
Fix is to replace line 2161 in projeqtor/model/SqlElement.php from

if (count($lst>0)) {

to

if (count($lst)>0) {

[EDIT]
Must also add lines before line 1526 on same file :

        if (!property_exists($oldObject,$col_name)) {
          continue; 
        }
        $col_old_value = $oldObject->$col_name;

We'll soon deploy a patch


 
Posté : 23/07/2020 6:17 pm
(@ma_bou)
Posts: 24
Trusted Member
Début du sujet
 

Works like a charm.

Thanks for your quick reply!


 
Posté : 23/07/2020 8:02 pm
Share:
Retour en haut