Tested locally and also on simpletest.me with Safari, Chrome, Firefox.

The draggable table on image style form (admin/config/media/image-styles/manage/{image_style}) is broken. The non-JS version with weight selects is displayed.

See screenshot.

CommentFileSizeAuthor
#14 theme_table.txt5.89 KBvijaycs85
#5 2171737-5.patch545 byteswim leers
is.png67.02 KBclaudiu.cristea

Comments

vijaycs85’s picture

The #tabledrag is processed drupal_pre_render_table() and for some reason it is not getting called on this page (though theme_table() does), not sure why. it would be an issue with combination of theme_image_style_preview + drupal_pre_render_table

claudiu.cristea’s picture

I see but prior that patch worked. So. somehow that patch was not addressed all aspects?

nod_’s picture

Component: javascript » base system
Issue tags: -JavaScript

Doesn't look like a JS issue to me.

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new545 bytes

#3: I manually tested everything that was affected — see #732022-32: drupal_add_tabledrag() still using drupal_add_(js|library)(), should return array for #attached. Somehow this must've sneaked through the cracks.

The fix is trivial: use #type => table instead of #theme => table.

wim leers’s picture

Issue tags: +Spark
vijaycs85’s picture

Almost looked at that line 10x and couldn't get that issue. Nice catch @Wim Leers :)

wim leers’s picture

Hehe, you found the underlying problems with using #theme, you just didn't notice that tiny part :)

claudiu.cristea’s picture

Status: Needs review » Reviewed & tested by the community

RTBC if green.

tstoeckler’s picture

+++ b/core/modules/image/image.admin.inc
@@ -54,7 +54,7 @@ function theme_image_style_effects($variables) {
     '#rows' => $rows,
...
+    '#type' => 'table',

Don't want to un-RTBC this since this is a major bug, but generally the rows of a #type table are added as child elements of the table elements. This is the #theme table way of doing it.

wim leers’s picture

#10: "generally" maybe though I personally didn't know about this, but if that's how it's intended to work, then #rows should simply be removed? :)

tstoeckler’s picture

Re #11: Sorry, I should have explained that better:

Using #rows works and therefore #5 is fine and due to the issue status I support RTBC. However, #rows expects a certain data structure. Most importantly, it does not support render arrays as cells. This can be seen in theme_image_style_effects() in particular, as all of the cells have to be drupal_render()ed before being but into #rows. #type table would allow to simply leave those as render arrays and put them into $table[$row][$column]. This is preferable for the reason above and several others.

wim leers’s picture

#12: I see :) Yeah, let's do that in a follow-up.

vijaycs85’s picture

StatusFileSize
new5.89 KB

on the other note, we got 46 instance of #theme => table (on a rough search). Is it worth opening an issue with fixing them with #type => table where appropriate and a test case to make sure we are good?. Attaching the search result for reference.

wim leers’s picture

#14: you may want to look at #2152193: Discuss the fate of #type table for that.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Hm. I can't think of a way to test this that doesn't special-case this one table, which doesn't make a whole lot of sense as a test. So I think this is good to go, despite lacking test coverage.

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.