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

Select from server & Upload image buttons not working #4469

Closed
GwendolenLynch opened this issue Nov 16, 2015 · 5 comments
Closed

Select from server & Upload image buttons not working #4469

GwendolenLynch opened this issue Nov 16, 2015 · 5 comments
Labels
blocking release bug A bug that has been verified regression

Comments

@GwendolenLynch
Copy link
Contributor

In the record editor, both of them add the image to the stack, but not the record field.

@rarila I have a feeling this might have snuck in recently with that last set of module changes

@GwendolenLynch GwendolenLynch added bug A bug that has been verified blocking release regression labels Nov 16, 2015
@GwendolenLynch GwendolenLynch added this to the Bolt 2.3 - Feature release milestone Nov 16, 2015
@sbonardt
Copy link
Contributor

Nice! I actually ran into this issue as well today. 👍

@rarila
Copy link
Contributor

rarila commented Nov 16, 2015

Quite possible… any chance to blame the 🐨 ?!

@GwendolenLynch
Copy link
Contributor Author

The question is @rarila, was it the 🐭 🐹 🐰 🐺 🐸 🐯 🐨 🐻 🐷 🐮 🐒 🐫 🐑 🐘 or 🐍… one of them is making someone a sad 🐼

@Boorj
Copy link
Contributor

Boorj commented Nov 16, 2015

@Boorj
Copy link
Contributor

Boorj commented Nov 16, 2015

fieldset has class .bolt-field-image but no attribute/property data-bolt-field='image'
i suppose some fixes here https://github.com/bolt/bolt/blob/master/app/view/twig/editcontent/fields/_image.twig#L87 could save the world today..
tried to make $('.bolt-field-image').data('bolt-field', 'image') in console and upload again - that worked.

upd
this code ( https://github.com/bolt/bolt/blob/master/app/view/twig/_base/_fieldset.twig#L16 ) produces only class and data-bolt-widget

{% set attributes_fieldset = {
    'class':             'form-group bolt-field-' ~ block('fieldset_type'),
    'data-bolt-widget':  data_bolt_widget,
} %}

and this code expects some data-bolt-field to detect, what is this upload for.

switch ($(fieldset).data('bolt-field')) {
                    case 'file':
                    case 'image':
                       ...
                    case 'filelist':
                    case 'imagelist':
                       ...
                    default:
                    bolt.stack.addToStack(file.name);
                }

So 2 solutions:

  1. detect by class (if you don't need extra attributes) in js
  2. add the attribute in twig

The 2nd option worked for me:

'data-bolt-field':   block('fieldset_type'),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking release bug A bug that has been verified regression
Projects
None yet
Development

No branches or pull requests

4 participants