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

LiveForm -> Invalid model name #23

Open
xDeSwa opened this issue Jun 10, 2024 · 1 comment
Open

LiveForm -> Invalid model name #23

xDeSwa opened this issue Jun 10, 2024 · 1 comment

Comments

@xDeSwa
Copy link
Contributor

xDeSwa commented Jun 10, 2024

hi,
i using Live Form components

Example 1 (this giving error 'Uncaught Error: Invalid model name' in console. but everything working well )

  • ux v2.13.0
    • Throwing an error when setting an invalid model name.
->add('images', UxMediaCollectionType::class, [
                'conf' => 'default',
                'entry_options' => ['readonly' => false]
            ])

Example 2 (no error, working well too)

->add(child: 'images', type: LiveCollectionType::class, options: [
     'entry_type' => UxMediaType::class,
     'entry_options' => ['label' => false,'conf' => 'default',],
     'label' => false,
     'allow_add' => true,
      'allow_delete' => true,
      'by_reference' => false,
])

Even though it worked perfectly, I wanted to solve the error but I couldn't find it. Do you have any ideas about this?

@Arkounay
Copy link
Owner

Arkounay commented Jun 10, 2024

Hi, I hadn't tested Live components with this bundle as it's pretty recent. TBH I thought it was still experimental but I just saw it's now been considered stable since v2.16, so I'll check it out (but will not support version <2.16)
At first sight it looks like there might be some issues with media not being sent when using live actions, but I couldn't reproduce that "invalid model name" error right now. (but I tested with the latest ux version)
I'll investigate

edit: I could reproduce the error, but not sure how to fix it right now because it seems to be caused by the ux live_controller, it looks like it needs the items to be added in the php objects directly so it can be tied with the dom. I guess it's better to use solution from example 2 for now

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