If an SDC has a boolean prop, then any field value passed to it should be typecast to a bool. Same argument for other prop types.

-mike

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

ultimike created an issue. See original summary.

lostcarpark’s picture

I think the problem is that typed props expect a value of the correct type, but Views are feeding a rendered value that is in effect always a string.

I plan to make the module detect the prop type and feed appropriate values.

lostcarpark’s picture

Now working (with tests) for boolean fields.

Next: replicate for integers!

lostcarpark’s picture

Status: Active » Needs review

I have added support for Integer fields. Test cover for booleans and integers is pretty good.

I propose wrapping up this issue here, but test for other types, and open other issues if problems arise.

@ultimike, would you like to review?

ultimike’s picture

@lostcarpark -

Looks good. I manually tested with 3 different custom SDCs with both boolean and integer fields.

Thanks!
-mike

lostcarpark’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +DevDaysAthens2026

Thanks Mike!

Adding issue tag and moving to RTBC.

  • lostcarpark committed 5478048a on 1.0.x
    feat: #3585495 Typecast variables for props
    
    By: ultimike
    By:...
lostcarpark’s picture

Status: Reviewed & tested by the community » Fixed

Merged and moving to fixed.

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

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

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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