refinery/refinerycms-page-images

cannot add imagens using the "search" feature

Closed this issue · 4 comments

flep commented

For some strange reason when using the search input the images won't be added.

To reproduce the error:

  1. click on de Add Image, opening the gallery
  2. use the search to find any of the existing images that you have
  3. select the image and click "insert image"
  4. nothing will happen.

We tried to fix this but the error is way too deep into the javascript functions.
On our debug tests the error starts on the "insert.html.erb" file (view), line 44 "image_dialog.init"

When using the normal way of insert images, the callback works, when using the result after a search the callback always return null.

Fixing it manually - to keep debugging it - resulted in another error on the file "refinery/admin.js", line 854 on the function ".click($.proxy(_this.submit_image_choice, _this));" that always return an error

This is causing a big problem for my team here, as we are close to the deadline of a project and the client is really needing the search to work properly to add images.

Anyone have a clue or can help to fix this? Maybe we are debugging it wrong, so if anyone can look into this I'll be very thankful.

Thanks!

I resolved this in view shared/admin/_search.html.erb
Add line <% if @callback.presence %>
And a input name='callback' value='<%= @callback %>' type='hidden'><% end %>

That's work for me.

Okay so has this fix gone into Refinery CMS?

Submitted pull request:

https://github.com/resolve/refinerycms/pull/856

to resolve this issue.

Thanks, merged it!