Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Froala wysiwyg Uploading Image Issue #44

Open
Slgoetz opened this issue Oct 13, 2020 · 2 comments
Open

Froala wysiwyg Uploading Image Issue #44

Slgoetz opened this issue Oct 13, 2020 · 2 comments

Comments

@Slgoetz
Copy link

Slgoetz commented Oct 13, 2020

It seems that the Conditional Container removes the fields from the Nova Fields Collections so that ->availableFields() doesn't return them. When we try to upload an image we get a 404 since the field is non existent in the data. Is there another way to field the field, and is there a reason you're removing them from the Nova Field Collection?

@milewski
Copy link
Member

All fields within a conditional container get removed if the if() condition doesn't match, that how this package works, in order to make this work with froala perhaps we need to modify the availableFields() method from the HasConditionalContainer to identify this is a request targeting some specific field within a possibly deep nested conditional container field

@manyasone
Copy link

manyasone commented Mar 12, 2021

A workaround for this is checking the requestUri, in my case using the QuillJs field:

/**
 * Get the fields displayed by the resource.
 *
 * @param \Illuminate\Http\Request $request
 * @return array
 */
public function fields(Request $request)
{
    ...

    if ($request->getRequestUri() === '/nova-vendor/quilljs/modules/upload/content') {
        $data[] = Quilljs::make(__('validation.attributes.content'), 'content')
            ->withFiles()
    }

    return $data;
}

I use this with the BelongsToManyField as well:

if ($request->getRequestUri() === '/nova-vendor/belongs-to-many-field/modules/options/videos/name') {
    $data[] = BelongsToManyField::make(__('validation.attributes.videos'), 'videos', $this->videoResource());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants