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] count(): P...
 
Notifications
Clear all

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

3 Posts
2 Users
0 Reactions
3,769 Views
(@ma_bou)
Posts: 24
Active Member
Topic starter
 
[#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.


 
Posted : 23 Jul 2020 14H49
babynus
(@babynus)
Posts: 14966
Main Contributor 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


 
Posted : 23 Jul 2020 18H17
(@ma_bou)
Posts: 24
Active Member
Topic starter
 

Works like a charm.

Thanks for your quick reply!


 
Posted : 23 Jul 2020 20H02
Share:

Scroll to Top