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

Mediables table not being updated when used as a block by block_editor #77

Closed
milewski opened this issue Nov 12, 2018 · 1 comment
Closed
Labels
type: enhancement New feature or request

Comments

@milewski
Copy link
Contributor

milewski commented Nov 12, 2018

Hello i have the following:

// some form.blade.php
@formField('block_editor', [
    'blocks' => ['gallery_tab'],
    'withoutSeparator' => true
])

/// gallery_tab.blade.php with the following

@formField('input', [
    'name' => 'tab_title',
    'label' => 'Tab Title'
])

@formField('medias', [
    'name' => 'images',
    'label' => 'Images',
    'note' => 'Minimum image width 1300px',
    'max' => 10,
])

image

when click save it does not persist the images to db.. only if i dont use it as a block_editor.. perhaps medias inside a block is not yet supported?

i have also noticed that it didnt work initially if i didnt add $mediasParams to my model, the docs wasn't clear if that was a requirement.. perhaps this should be optional?

@ifox
Copy link
Member

ifox commented Nov 13, 2018

Hi Rafael,

As you correctly identified, $mediasParams is required as it is letting the model know about fields you'd like to save from your module's form. We could make it optional by providing a default configuration when a medias field name is not found in $mediasParams, thanks for your suggestion.

It works similarly in blocks, except the Block model is living in Twill's codebase which means it's mediasParams is controlled through your twill.php configuration file, under crops. You can take a look at the default block editor configuration here. I'll admit naming is not consistent here, and documentation is not as straightforward as it should be. So something to improve, definitely!

@ifox ifox added type: enhancement New feature or request type: documentation This issue means we need to improve docs labels Nov 13, 2018
@yanhao-li yanhao-li removed the type: documentation This issue means we need to improve docs label Mar 14, 2019
@ifox ifox closed this as completed Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants