Skip to content

Forced Trix field attachments #100

@fkeloks

Description

@fkeloks

Hello,

I get an error when I try to delete a template that has a Trix field without an attachment:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nova_trix_attachments' does not exist

I think the error comes from this line:
https://github.com/spatie/nova-translatable/blob/3.x/src/Translatable.php#L254

By default attachments are disabled and this method force its activation ($this->withFiles = true;)
By removing the withFiles() I no longer get the error

    private function createTrixUploadField(Trix $field, string $locale): Trix
    {
        return Trix::make('translations_' . $field->attribute . '_' . $locale)
            /* ->withFiles(
                $field->getStorageDisk(),
                $field->getStorageDir()
            ) */
            ->hideFromIndex()
            ->hideWhenCreating()
            ->hideFromDetail()
            ->hideWhenUpdating();
    }

Sincerely

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions