This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

raakesh
raakesh

I'm getting an error when I try to add fileupload widget to the Pages (RainLab Pages plugin). The error is

"Call to undefined method October\Rain\Halcyon\Builder::hasRelation()" on line 776 of /home/project/public_html/wipaq/vendor/october/rain/src/Halcyon/Builder.php

field.yaml

pdf_files:
    tab: PDF Files
    label: PDF Files
    type: fileupload
    mode: file

Page.php

    /**
     * @var array Attach Many relation
     */
    public $attachMany = [
      'pdf_files' => ['System\Models\File', 'order' => 'sort_order'],
    ];
{variable tab="PDF Files" type="fileupload"  name="file" label="PDF Files"}{/variable} 

Even the above code isn't working after adding to the layouts

I don't know why this isn't working. Is there any other workaround?

Last updated

Renatio
Renatio

I don't think RainLab.Pages plugin support fileupload field or it will in near future.

Pages are stored as flat files and upload widget need database record to bind to.

Another thing is that you are modifying core files here, which is not recommended. After each update you will loose those changes.

The best approach here is to create custom plugin with component that outputs pdf files for you.

raakesh
raakesh

Thanks Renatio :)

I din't know that RainLab.Pages plugin doesn't support fileupload field. I already wrote a custom plugin for pdf files. I just wanted to see if I can implement in to Pages plugin.

adc_91
adc_91

I'm with the same problem. In my case, I'm wanting to extend the form and add a tab to the Pages plugin. I was able to create fields but the time to use the type fileupload I get this error. Any idea how to do it?

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.