octobercms / october

Self-hosted CMS platform based on the Laravel PHP Framework.
https://octobercms.com/
Other
10.99k stars 2.22k forks source link

Bug: Fileupload does not support in repeater #1637

Closed prhost closed 8 years ago

prhost commented 8 years ago

When I use fileupload the repeater, he repeats the same image selected an item for all items when saving.

Another discussion about the same thing. https://octobercms.com/forum/post/form-widgets-repeater?page=1

dougogodinho commented 8 years ago

I have the same problem...

seanthepottingshed commented 8 years ago

@daftspunk - is there a workaround for this occurence?

estate_agents:
            label: thepottingshed.contentfeeds::lang.settings.fields.estate_agents
            type: repeater
            tab: Properties
            form:
                fields:
                    name:
                        label: thepottingshed.contentfeeds::lang.settings.fields.estate_agent_name
                        placeholder: thepottingshed.contentfeeds::lang.settings.fields.estate_agent_name_placeholder
                    url:
                        label: thepottingshed.contentfeeds::lang.settings.fields.estate_agent_url
                        placeholder: thepottingshed.contentfeeds::lang.settings.fields.estate_agent_url_placeholder
                    estate_agent_logo: 
                        label: thepottingshed.contentfeeds::lang.settings.fields.estate_agent_logo
                        type: fileupload
                        mode: image
                        span: left
                        imageWidth: 160
                        imageHeight: 90
    public $attachOne = [
        'estate_agent_logo' => [
            'System\Models\File',
        ],
    ];
daftspunk commented 8 years ago

File upload depends on a relationship definition so the support is difficult. A suggestion would be to use the mediafinder form field instead. We should add to the documentation that form fields that depend on relations are not supported.

lilessam commented 7 years ago

I get an error every time I use 'fileupload' in a repeater in my theme.yaml Would any body know how to resolve this problem? Or it's just not supported yet?

daftspunk commented 7 years ago

This was added in a recent build. It is working for me over here:

tabs:
    fields:
        site_logo:
            label: Logo
            type: fileupload
            mode: image
            tab: Logo
            imageHeight: 150
LukeTowers commented 7 years ago

@daftspunk I get a plain 500 error with no other information when attempting to save a record where I use the fileupload field in a repeater with an attachMany or an attachOne relationship setup. The repeater also includes itself for new items as shown in this screenshot

options[powerpoint][slides]:
    label: 'look.coursemanager::lang.models.material.types.powerpoint.slides.label'
    prompt: 'look.coursemanager::lang.models.material.types.powerpoint.slides.add_new'
    span: full
    type: repeater
    tab: 'look.coursemanager::lang.controllers.tabs.options'
    form:
        fields:
            slide_image:
                label: 'look.coursemanager::lang.models.material.types.powerpoint.slides.image'
                span: full
                mode: image
                type: fileupload
                fileTypes: jpg,jpeg,png,gif
                useCaption: false

            slide_title:
                label: 'look.coursemanager::lang.models.material.types.powerpoint.slides.title'
                span: full
                type: text

            slide_content:
                label: 'look.coursemanager::lang.models.material.types.powerpoint.slides.content'
                span: full
                type: textarea
LukeTowers commented 7 years ago

@daftspunk, never mind, my issue seems to be a separate issue relating to dynamically adding repeater fields. I'll open a new issue to cover it

WaskiWabit commented 7 years ago

Has this been resolved? There are a few of us out there that are pushing October CMS to the limit. Not by choice or on purpose. But because we love it and what it's capable of.