You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception 'TypeError' with message 'Argument 1 passed to craft\helpers\StringHelper::toLowerCase() must be of the type string, array given, called in /app/user/vendor/craftcms/cms/src/helpers/Db.php on line 448'
It seems to me that this feature is not fully/correctly implemented. Here is the craft\fields\Asset::normalizeValue source:
publicfunctionnormalizeValue($value, ElementInterface$element = null)
{
// If data strings are passed along, make sure the array keys are retained.if (isset($value['data']) && !empty($value['data'])) {
/** @var Asset $class */$class = static::elementType();
/** @var ElementQuery $query */$query = $class::find()
->siteId($this->targetSiteId($element));
// $value might be an array of element IDsif (is_array($value)) {
$query
->id(array_filter($value))
->fixedOrder();
if ($this->allowLimit === true && $this->limit) {
$query->limit($this->limit);
} else {
$query->limit(null);
}
return$query;
}
}
returnparent::normalizeValue($value, $element);
}
As you can see it checks if the data key is present, but that's about it. The query code doesn't make sense to me in relation to the data key values.
Steps to reproduce
Create a content migration where you add an image inline, as shown in the example above.
Description
According to my understanding of the code, adding an asset programmatically via base64 is supposed to go like this:
However, I get the following exception:
It seems to me that this feature is not fully/correctly implemented. Here is the
craft\fields\Asset::normalizeValue
source:As you can see it checks if the
data
key is present, but that's about it. The query code doesn't make sense to me in relation to thedata
key values.Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: