Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
image.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Mar 2013 at 19:19 UTC
Updated:
29 Aug 2014 at 15:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #0.0
duellj commentedUpdated issue summary.
Comment #1
larowlanWill tackle this once #1788542: Use EntityFormController and EntityListController for image styles is in
Comment #2
star-szrI think theme_image_anchor and theme_image_style_list might need to be removed from here since they're not form tables.
Comment #3
andyposttheme_image_style_list() will gone with #1809376: Use EntityListController for image styles other issues are nothing about form controller
Comment #3.0
andypostUpdated issue summary.
Comment #4
star-szrThanks @andypost, updated summary to cross out all but theme_image_style_effects and updated #1898420: image.module - Convert theme_ functions to Twig
Comment #5
jibranTagging.
Comment #6
Brandonian commentedNeeds work, but wanted to get something up before lunch.
Issues with the current patch.
Comment #7
jibranComment #8.0
(not verified) commentedCross out functions that need not be converted
Comment #9
dsnopekRe-rolled the patch in #6 so it'll apply cleanly. No other changes were made.
Comment #10
dsnopekActually, I started thinking about this and I think this patch is going in the wrong direction. It's replacing the code in
theme_image_style_effects(), but what it probably should be doing is REMOVING that theme function all together and put the '#type' => 'table' element directly into the form!Comment #11
larowlanComment #12
andypostmaybe #empty needed here
trailing whitespace
Comment #13
jeroentMade changes to dsnopek's patch as suggested by andypost.
Patch attached.
Comment #14
andypostAwesome! Just a small nitpick
'Else' should be on new line, see https://drupal.org/coding-standards#controlstruct
Comment #15
jeroentHi Andy,
I changed the else.
Patch attached.
Comment #16
andypostAnd the last one, @JeroenT sorry that I missed that in previous review
Code now much cleaner!
It would be good to make follow-up to remove this ugly "add effect" drop down and use inline action a-la we have for menu links and proposed for fields #1963340: Change field UI so that adding a field is a separate task
please leave the comment here, it useful to point wtf going here
Comment #17
jeroentI made 2 patches.
drupal8.image-module.1938910-17.patch is the one where I added the comment again.
drupal8.image-module-inline-action.1938910-17.patch is the patch where i started on the inline action. It works locally but there are still some tests failing (I think they need to be changed).
Comment #19
andypost@JeroenT Let's leave the scope of that issue to straight conversion
Filed #2116663: Move Add new effect out of effects table
Comment #19.0
andypostAdded instructions for testing manually.
Comment #20
jeroentReadded the comment + made some changes to fix the tabledrag.
Comment #21
jeroentSmall change for coding standards.
Comment #22
joelpittetMind adding a comma to the end of the array item?
This patch is looking pretty close to ready.
Comment #23
jeroentAdded the comma as suggested by joelpittet.
Comment #24
jeroentComment #26
joelpittet#type=>table got some improvements recently it seems, the array going in is key'd, that's the issue here.
This can very likely be done without drupal_render() being called which would really help. Want to give it a crack or more details on how that would be done?
I think we are missing the class from this. It's on the div so I think #type=>container or something like that could do the trick.
Comment #27
jeroentThis patch should fix all the exceptions + the suggestions made by joelpittet.
Comment #28
joelpittetNice work on getting it green. Dreditor seem to be buggered for me so I'll wait to do a code review.
Can you drop the theme function out of this equation, all it does is create a table.
All the code here get's simplifed a bit by moving it to ImageStyleEditForm::form.
Also, if you can prevent the early rendering inside the table it's even better(no drupal_render calls, I'm quite sure it's possible:)
There is a 4 space indent in there too that should be 2.
Have a look at https://drupal.org/node/1876710 for reference on keeping the 'draggable' class attribute consistent.
Comment #29
jeroentI think we are almost there, but I can't find a way to add the "image-style-order-weight" class to the td elements.
Comment #31
pratik60 commentedIt was a small fix, the associative array for tablegroup was wrong.
Comment #33
jeroentFixed some of the remaining issues.
Patch attached.
Comment #34
jeroentComment #36
jeroentFixed the last remaining failed tests.
Patch attached.
Comment #37
jeroentComment #38
jeroentComment #39
joelpittetGreat work @JeroenT, just a couple things and questions for you. I'll do a manual test after that to see how things are working and matching up.
You can now use $this->t inside the form, to remove the global dependency on the t function, which will likely turn into a trait method once PHP 5.4 is in.
Is this to be an empty cell?
Comment #40
jeroent1. I changed the t() function with $this->t().
2. Yes. Currently it's done like this in theme_image_style_effects() :
Maybe it's better to add a colspan to the td element, but I can't find a way to add it.
Comment #41
jeroentComment #42
joelpittetThanks @JeroenT you rock. I don't think there is a colspan ability in type table. I spotted #1065828: Make type #table support colspan for cells so that conversion should be good enough.
I'll do a manual testing on this and if I see a solution I'll let you know.
Comment #44
joelpittetComment #45
jeroentComment #46
joelpittetHmm, haven't had a time to do manual testing, I'll have to just open this up and unassign for now.
Comment #47
jeroentAfter reviewing the HTML-code I still found a difference. After applying this patch the HTML-code has no differences.
Comment #48
gnuget#47 not apply anymore, here a reroll.
Comment #49
gnuget47: drupal8.image-module.1938910-47.patch queued for re-testing.
Comment #51
temoor commented#48 not applied
Re-rolled patch, added missing table header.
Comment #53
temoor commentedUpdated tests to match with name and proportions splitted in separate columns.
Comment #54
joelpittet@Temoor why did the tests need to change?
And can you provide an interdiff for the changes so we don't have to review each like for each new patch and concentrate on the changes between them. @see https://drupal.org/documentation/git/interdiff
Comment #55
temoor commentedI've missed two lines while making reroll.
Attached patch doesn't contain any additional changes and is clean reroll of #48.
Btw, how interdiff can be made with a patch that doesn't apply anymore?
Comment #56
joelpittet@Temoor good question, usually just post the re-roll first then do another patch for the changes. It gives a chance for the testbot to run against the re-roll to make sure no mistakes were made. Then the interdiff can tell the people reviewing the patch what has changed since the actual last change, which is much tougher to do mixed in with the re-roll changes as well.
Comment #57
mondrakeTested manually, works fine and BTW also solves part of #2318297: Rotate effect: do not use html entity for 'degree' but its unicode character i.e. double-escaping of HTML in the image style effects table. RTBC for me. Adding Twig tag as it would reduce count of theme_* functions by one.
Comment #58
alexpottTested manually and nice one less SafeMarkup::set() and one less theme function!
Committed 83fa87f and pushed to 8.0.x. Thanks!
Comment #60
m1r1k commented