Problem/Motivation

When attempting to use the shs module, I encountered a TypeError related to the count() function. The error message indicates that the first argument passed to count() must be of type Countable|array, but an int was given instead.
TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given in count()

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#6 shs.mkv1.62 MBlavanyatalwar
#2 3513876.patch1.02 KBcatcat811

Issue fork shs-3513876

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

catcat811 created an issue. See original summary.

catcat811’s picture

StatusFileSize
new1.02 KB

arunsahijpal made their first commit to this issue’s fork.

arunsahijpal’s picture

Status: Active » Needs review

Created an MR and also fixed the pipeline.

lavanyatalwar’s picture

StatusFileSize
new1.62 MB

Hi @catcat811, @arunsahijpal,
I’m unable to reproduce this error. I added Simple Hierarchical Select as the widget and tried adding terms and sub-terms in my vocabulary. Everything worked fine, and the content was added without any issues.
Could you please let me know if I’m missing something?
I am adding screen recording of the same for your reference.

lavanyatalwar’s picture

  • joseph.olstad committed d705cb7b on 3.0.x
    [#3513876] feat: TypeError: count(): Argument #1 () must be of type...

  • joseph.olstad committed a9ee98f4 on 2.0.x
    [#3513876] feat: TypeError: count(): Argument #1 () must be of type...
joseph.olstad’s picture

Version: 2.0.2 » 2.0.x-dev
Assigned: catcat811 » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.