Follow-up to #2861165: Not properly closing div on bootstrap_image_widget template function

Something went wrong with this change... the UI looks broken now.

Files: 
CommentFileSizeAuthor
#9 not_properly_closing-2870204-9.patch7.17 KBmarkcarver

Comments

hass created an issue. See original summary.

fmfpereira’s picture

Weird! If you use older version does it work ok?

I will try to inspect if there are other preprocess functions . Last version was indeed closing the div on the wrong #suffix element.

hass’s picture

FileSize
2.78 KB

While we are on the image upload widget... the drag and drop icon is incorrectly shown. On the right side it id half hidden.

hass’s picture

Issue summary: View changes
hass’s picture

I'm sure the upload form was correctly shown in 3.12...

markcarver’s picture

Priority: Major » Normal
Related issues: +#2870289: file_ajax_upload() causes malformed Drupal.settings

It is broken. I shouldn't have committed the patch in #2861165: Not properly closing div on bootstrap_image_widget template function.

I think the reason that issue was created (and why I committed it) is because the markup does look "wrong" at first glance.

It's actually wasn't.

There wasn't really a way to effectively "wrap" an input group div around both upload and upload_button since they're sibling child elements of the managed file element.

So yes, the closing </div> should be on upload_button, not as a suffix on upload.

---

That being said, I'd really like to avoid custom markup like this because it's easy to make mistakes like this.

I'll commit a fix shortly that converts this into using the proper #input_group_button property.

  • markcarver committed c62398b on 7.x-3.x
    Issue #2870204 by hass, markcarver: Not properly closing div on...
markcarver’s picture

Status: Active » Fixed

As a side note, in case you missed the above related issue:

#2870289: file_ajax_upload() causes malformed Drupal.settings

While this is the proper way to fix this issue, it does come with a slight annoyance. If the upload button is clicked without a file actually provided, it will inadvertently cause a JS fatal error due to the above core bug. The patch in that issue fixes it.

markcarver’s picture

FileSize
7.17 KB

Here's a patch, just in case.

hass’s picture

Thanks. That fixes the issue in the theme.

fmfpereira’s picture

Thank you, it also solves the initial issue #2861165: Not properly closing div on bootstrap_image_widget template function that was triggering other form fields to be wrapped in the image field.

My patch solved this issue but generated other problems that i was not ware. Sorry for the mess.