Skip to content

Can't upload image with custom fileAttachmentProvider #111

@Aliryn

Description

@Aliryn

When I try to set a custom fileAttachmentProvider:

TinyEditor::make('text')->fileAttachmentProvider(
CustomFileAttachmentProvider::make()
->collection('text')
)

The uploaded image is saved:

$nodeAttrsId = $component->saveUploadedFileAttachment($attachment);

But it is geting cleaned right after:

$fileAttachmentProvider?->cleanUpFileAttachments(exceptIds: $fileAttachmentIds);

The image HTML tag gets the new uploaded uuid from the custom provider:

$image->setAttribute('data-id', $nodeAttrsId);

But the $fileAttachmentIds array is filled with the old data:

$fileAttachmentIds[] = $fileKey;

Please change the 129 Line to:
$fileAttachmentIds[] = $nodeAttrsId;

And it will be good :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions