Coder Social home page Coder Social logo

Comments (8)

mplodowski avatar mplodowski commented on August 29, 2024

Hmm it is called on my test project. I checked form inside CMS Page, Static Page (component snippet).

Did you install responsiv/uploader-plugin using composer?

Please explain how do you use form and where do you put it.

from formbuilder-plugin-public.

sqwk avatar sqwk commented on August 29, 2024

I installed the uploader plugin through the October CMS project / the backend.

The form is embedded into a static page (variable, not the content field) via a snippet: <figure data-ajax="true" data-component="Renatio\FormBuilder\Components\RenderForm" data-property-formcode="some-form" data-snippet="renderForm">&nbsp;</figure>

from formbuilder-plugin-public.

mplodowski avatar mplodowski commented on August 29, 2024

I don't understand the part (variable, not the content field). Can you elaborate on this?

I have a static page and I clicked on the Snippets menu on the top bar then choose Render Form Component. I clicked on the snippet and choosed the form.

The second form I added using richeditor Insert Snippet button.

The result on the static page source code:

<figure data-ajax="true" data-component="Renatio\FormBuilder\Components\RenderForm" data-property-formcode="default-form" data-snippet="renderForm">&nbsp;</figure>
<figure data-component="Renatio\FormBuilder\Components\RenderForm" data-property-formcode="contact-form-2" data-snippet="renderForm1">&nbsp;</figure>

Both forms work fine (image upload and file upload works). Hmm they even work when I remove this data-ajax="true" attribute, which is weird.

from formbuilder-plugin-public.

sqwk avatar sqwk commented on August 29, 2024

By variable I mean that the static page does not use the default content field, but a custom repeater. The snippet is inserted in that rich editor, not in the default content field.

layout.htm

[staticPage]
useContent = 0
==
{repeater name="sections" groups="themes/some-theme/meta/generic-repeaters.yaml" tab="Content" prompt="Add a section"}
    {# parser fail if there is noting between open and close tag #}
{/repeater}

generic-repeaters.yaml

text:
    name: Text
    titleFrom: title
    description: Text
    icon: icon-newspaper-o
    fields:
        title:
            label: Title
            type: text
            span: full
        content:
            label: Content
            type: richeditor
            span: full

from formbuilder-plugin-public.

mplodowski avatar mplodowski commented on August 29, 2024

Hi,

I managed to replicate this issue. As I can see it, the onRun methods of formbuilder plugin as well of fileupload plugin are running, but the assets are not injected. Maybe it is too late in the process of serving page. Maybe this is a bug of October, so they can help with this issue.

I tried to solve this by adding missing assets manually with onStart() function. This works, but another problem is the fileupload component is not bound to controller and ajax handler onUpload() is missing when you try to add file using the form. This also can be an issue how October handle this type of snippets.

If you have time please report this to October team, maybe they will figure this out.

from formbuilder-plugin-public.

sqwk avatar sqwk commented on August 29, 2024

OK, good to know that is not only isolated to my test system. Unfortunately, I am not 100% what to report to the October team. I have tried playing with the code, but haven't really come to any conclusion.

As of now; I believe that it might be best to remove the Uploader dependency entirely, since October's AJAX framework apparently supports uploads in v3. (See responsiv/uploader-plugin#77 and https://docs.octobercms.com/3.x/cms/features/uploads.html) No need for nested components, it removes three JS dependencies and it could potentially be much cleaner.) Happy to open another ticket for this.

from formbuilder-plugin-public.

mplodowski avatar mplodowski commented on August 29, 2024

Yeah I agree, that would be the best way to proceed this. I will try my best to add this feature next week.

from formbuilder-plugin-public.

mplodowski avatar mplodowski commented on August 29, 2024

As discussed I added ajax file uploads in v4.0, so this should be fixed.

from formbuilder-plugin-public.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.