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
Image browser attached to field doesnt work if field is in a modal #6236
Comments
@docwilmot One minor issue I saw in the code (an extra WFM! |
Fixed stray semicolon |
Looks good to me. |
@docwilmot Could you check if this suggested change is reasonable? https://github.com/backdrop/backdrop/pull/4526/files#r1348192527 |
Thanks for the quick update @docwilmot! I re-tested and the new selector is getting used. I merged backdrop/backdrop#4526 into 1.x and 1.26.x. Thanks to you and @laryn for reviewing! |
Description of the bug
If you implement a
managed_file
field and add the#browser_view
key to the array, the button to browse existing files appears, and when clicked, launches the image browser in a modal. This works fine on forms like the node page, but what if your field is already in a modal? Well, the image browser modal pops out, and when you click the insert button closes the original modal too.Steps To Reproduce
Simplest is to hack core: go to
core/layout/includes/block.hero.inc
and add'#browser_view' => 'image_library',
to the$form['image']
array in theform()
function. Then start add a Hero block to any layout, and you get this:Actual behavior
But if you try to select existing file, after clicking
insert
it closes the Hero block config modal. The browser works fine if you add the#browser_view
key to a field that's not in a modal. (Feel free to hack another core or contribmanaged_file
field to see that it works fine otherwise).Expected behavior
Clicking
insert
should return you to your previous modal, with the selected image active in the image field.The text was updated successfully, but these errors were encountered: