Problem/Motivation

When trying to create a new Content Type and add PowerBI Embed field, I get this error:
"This value should be of the correct primitive type" and all PowerBI Embed related fields are highlighted
This is on a Drupal 10.4.6 site

Steps to reproduce

1) Create new Content Type
2) Add PowerBI Embed field to the Content Type
3) Fill all fields and try to Save

Issue fork pwbi-3537915

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

westdylank created an issue. See original summary.

westdylank’s picture

I debugged this further and added the following code and printed out the value that was triggering this error in the /web/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/PrimitiveTypeConstraintValidator.php:

    if (!$valid) {
      // @todo Provide a good violation message for each problem.
      $msg = $constraint->message . " ||| " . print_r($value, TRUE);
      $this->context->addViolation($msg, [
        '%value' => is_object($value) ? get_class($value) : (is_array($value) ? 'Array' : (string) $value),
      ]);
    }

This is the value I get along with the error message. In the config form, I had used 100, 100, 100 for the breakpoints and % as the value type:

Array
(
    [pwbi.sm] => Array
        (
            [height] => 100
        )

    [pwbi.md] => Array
        (
            [height] => 100
        )

    [pwbi.lg] => Array
        (
            [height] => 100
        )

)
enriquelacoma’s picture

Assigned: Unassigned » enriquelacoma

enriquelacoma’s picture

Version: 1.0.2 » 2.0.3
enriquelacoma’s picture

Assigned: enriquelacoma » aaron gil martinez
Status: Active » Needs review
aaron gil martinez’s picture

Looks good to me +1

aaron gil martinez’s picture

Assigned: aaron gil martinez » enriquelacoma
Status: Needs review » Reviewed & tested by the community

  • enriquelacoma committed aae8f344 on 2.x
    feat: #3537915 Getting error: "This value should be of the correct...
enriquelacoma’s picture

Status: Reviewed & tested by the community » 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.

enriquelacoma’s picture

Status: Fixed » Closed (fixed)