Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adding a select attribute to a product doesnt work in PHP >= 7.2.0 #9159

@alexrowesoap

Description

@alexrowesoap
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Sylius version 1.0.8

I'm experiencing unusual behaviour with select attributes. I've checked the issues on github and nothing matches currently. I've created a new select attribute, which has two options. On the product page, it's visible in the dropdown of attributes, yet when I select it and press "Add attributes", it doesn't add it to the list of attributes. The select does have an en_us translation. The ajax request is returning a 500, with an error of "Warning: count(): Parameter must be an array or an object that implements Countable" in src\Sylius\Bundle\AttributeBundle\Form\Type\AttributeType\SelectAttributeType.php (line 43).
This relates to a change in the count() function where from PHP 7.2.0 onwards, passing anything that doesnt implement a countable interface raises a warning.
WAMP stack, php 7.2.1 32bit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Potential BugPotential bugs or bugfixes, that needs to be reproduced.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions