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

Large image file in rich text editor breaks record. #3265

Closed
Axelgustavschnurer opened this issue Sep 6, 2023 · 3 comments
Closed

Large image file in rich text editor breaks record. #3265

Axelgustavschnurer opened this issue Sep 6, 2023 · 3 comments

Comments

@Axelgustavschnurer
Copy link

Issue Description:

When attempting to create a new record that includes large image files within a rich text editor, it results in a broken record. Opening such a record disables all navigation and prevents any modifications. While it's not precisely clear when the file size becomes too large limit, I've narrowed it down to being somewhere between 3.5 - 4 MB.

Steps to Reproduce:

  1. Create a new collection.
  2. Add a new rich text field.
  3. Create a new record.
  4. Insert an image into the rich text field.
  5. Save the record.

At this point, nothing visibly changes on the page. However, the record has been created, and it will become visible after refreshing the page. When you attempt to open the record, it will disable all navigation, requiring you to refresh the page to exit the record. When opening the record, you cannot edit any fields, however, you can delete the record from the collections page.

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Sep 6, 2023

When you are uploading an image from the editor, it is embedded as base64 text into the editor field.

If you open the browser inspect tool you most likely will see an error like "Setting the value of 'x' exceeded the quota." and this is a browser limitation.

There is no feasible solution at the moment for this and I recommend one of the following options:

  • downsize your image
  • upload the image as collection field and use its url (or a url to a thumb) in the editor img popup.

In the future there will be an option to directly pick and browse files in the editor from all collections that has a file field (something like "Media library"), but for now this remains a low priority.

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Sep 6, 2023

On second thought, this actually can be avoided if we skip the draft JSON serialization in case of an error to prevent breaking the record panel.

I'll push an update sometime later today.

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Sep 6, 2023

I've pushed a fix in master (ca136c5) and it will be available with the next minor v0.18.2 release sometime later this week.

It catches the quota error so you'll be able to save and interact with your record but the recommendations from the earlier comment still remain and larger images are better uploaded as dedicated collection file field.

I'll consider maybe after roadmap#36724684 to priotize the "Files browse/Media library" TinyMCE plugin.

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

2 participants