Opensourcepos: Error when adding a new item ... count method requires countable object.

Created on 19 Oct 2018  路  3Comments  路  Source: opensourcepos/opensourcepos

I'm out of time to chase this one down so I thought I'd go ahead and report it.
When adding an item I encountered the following error message.

Using PHP 7.2.4 and MariaDB 10.2.14

Message: count(): Parameter must be an array or an object that implements Countable
Filename: models/Attribute.php
Line Number: 130

Backtrace:

File: C:\vroots\ospos1\application\models\Attribute.php
Line: 130
Function: _error_handler

File: C:\vroots\ospos1\application\controllers\Items.php
Line: 419
Function: get_values_by_definitions

File: C:\vroots\ospos1\public\index.php
Line: 315
Function: require_once
Attribute Name

bug

All 3 comments

I bet it's with 7.2

I found this on the web and it appears to work. Try it and see.
Line 130: if(count($definition_ids ? : []))

Thanks @odiea. I think you nailed it because I haven鈥檛 added any attributes yet. And as @daN4cat points out 7.2 is more restrictive with data typing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

odiea picture odiea  路  5Comments

odiea picture odiea  路  3Comments

odiea picture odiea  路  3Comments

sanubari97 picture sanubari97  路  4Comments

danersan picture danersan  路  4Comments