Skip to content

"multiple" option for MaterialChoiceTableType doesn't work #39273

Description

@MattKelvin

Prerequisites

Describe the bug and add attachments

Hello,

The documentation (https://devdocs.prestashop-project.org/9/development/components/form/types-reference/material-choice-table/#body-inner) says that we can use multiple option "to enable multiple checkboxes selection or not".

But in fact, using the "multiple => false" option generate a fatal error in MaterialChoiceTableType

count(): Argument #1 ($value) must be of type Countable|array, string given


I have succeded to fix it with a small change in MaterialChoiceTableType but I don't think we should.

If we don't want multiple option, we must use ChoiceType : better UI, no "Select All", radios instead of checkboxes.

I think we should remove this option, PrestaShop never use it.

What do you think about it ? :)

Thank you

Expected behavior

We should have a checklist where we can only select one checkbox

Steps to reproduce

  1. Update CustomerType
  2. Add 'multiple' => false for the MaterialChoiceTableType group_ids
  3. Edit a customer

PrestaShop version(s) where the bug happened

8.2.1 (and probably before), 9.0.0

How you installed PrestaShop

git clone

PHP version(s) where the bug happened

8.1

If your bug is related to a module, specify its name and its version

No response

Your company or customer's name goes here (if applicable).

Mademoiselle bio

Metadata

Metadata

Assignees

No one assigned

    Labels

    8.2.xBranchBugType: BugMinorSeverity: minor bug > https://build.prestashop.com/news/severity-classificationNeeds documentationNeeds an update of the developer documentationWaiting for devStatus: action required, waiting for tech feedback

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions