Skip to content

Upload::make() confusion #1701

Answered by wsdnathan
wsdnathan asked this question in Q&A
Apr 28, 2021 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

The issue with the previously uploaded attachments failing to load seems related to this:

/vendor/orchid/platform/src/Screen/Fields/Upload.php line 116:

    // set load relation attachment
    $this->addBeforeRender(function () {
       $value = Arr::wrap($this->get('value'));

        if (! Assert::isIntArray($value)) {
            return;
        }

From the database value, $value is being set to this after Arr::wrap():

array:1 [▼
0 => "[78, 79, 80]"
]

This then always fails assertion if (! Assert::isIntArray($value))

If instead I set $value = array(78,79,80); then all the image attachments load as expected!

What am I missing here? Does the MySQL field attribute need to be of a spec…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@wsdnathan
Comment options

Comment options

You must be logged in to vote
2 replies
@tabuna
Comment options

@wsdnathan
Comment options

Answer selected by wsdnathan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants