Bug? Uploading files deletes content field

Hello,

I have a new content type called Factsheets. I can add a new Factsheet and fill in the title and content fields. However, when I upload a file, it emptys the content field?

Video demonstration: https://dl.dropboxusercontent.com/u/94440365/kirby.mov

Is this a known bug?

Could you post your blueprint, please?

Sure thing @texnixe :

<?php if(!defined('KIRBY')) exit ?>

title: Factsheet
pages: false
files: true
fields:

factsheetbanner:
    label: Factsheet Banner
    type: select
    options: images

title:
    label: Banner Title
    type: text

subtitle:
    label: Content Title
    type: text

factsheetcontent:
    label: Content
    type: wysiwyg
    size: large
    required: true

It seems that after a file uploads, it reverts to the last saved state of the content field…

Content: “Hello”.
Press Save.
Content: “Goodbye”. (Don’t press save).
Upload file.
File will upload and content will revert to “Hello”. (Last saved state).

I always save before uploading a file as I’ve experienced the same kind of behavior. I don’t find it abnormal though that interrupting your current action (entering content) with another action (uploading asset) can result in the loss of the current state of your initial action. It could be nice to have a warning on file upload when the page status is “unsaved changes” maybe?

@Tortai Do you get the same effect with a standard textarea field?

I did get that I believe. I’ll try to replicate it tomorrow

@Tortai My guess is that the problem might be related to the wysiwyg field. The field hasn’t been updated in nine month. I can replicate the issue with the wysiwyg field, not with a standard textarea field.

Edit: BTW, the textarea field does not have a size option (anymore). You can use a custom panel stylesheet if you need to style your fields. This is just on a side note, it does not have anything to do with the issue.

Hi @Thiousi,
That would be true if the upload file screen was on another page. But the user remains on the same page so there is no expectation that they are leaving the current state which may result in the lost of their changes.

This seems to be an issue with the wysiwyg plugin as far as I can tell…

I also can’t reproduce this with a standard textarea. Please contact the author of the field about this or use a different field. :slight_smile:

You can even leave the page, do an upload on another page and then come back, your changes will still be there (unless you use the wysiwyg field, that is).