Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This template contains a block of PHP code that should be located in the .module file, not the .tpl file.
https://skitch.com/jesse.beach/fkkgk/drupal-dev-netbeans-ide-7.0
Comment | File | Size | Author |
---|---|---|---|
#21 | drupal8.block-template-tabledrag.21.patch | 2.71 KB | sun |
#18 | 1221718-block-template-fail-unix.patch | 2.33 KB | aspilicious |
#16 | 1221718-block-template-fail.patch | 2.39 KB | aspilicious |
#13 | drupal8.block-admin-js.13.patch | 2.17 KB | sun |
#3 | block_admin_refactor-1221718-2.patch | 2.09 KB | skottler |
Comments
Comment #1
jessebeach CreditAttribution: jessebeach commentedIt might even be better to eliminate this .tpl file altogether and move all of this logic into a renderable array.
Comment #2
skottler CreditAttribution: skottler commentedI think that we need to look at condensing functionality that this TPL provides. @jessebeach, a renderable array is probably ideal. This would also make it easier to remove the table drupal_add_js and drupal_add_css' from the template.
Marking needs work.
Comment #3
skottler CreditAttribution: skottler commentedI've started to refactor this system, as per the attached patch. This is the start of an effort to move logic out of the template for the block admin section. Essentially, this patch is the beginning of ripping the 'horribleness' out of the block module. This patch passed simpletests for the block system locally.
Comment #4
attiks CreditAttribution: attiks commentedTested it as well and all in favor
Comment #5
jessebeach CreditAttribution: jessebeach commentedTested as well. Looks like a nice, small, committable cleanup.
Comment #6
Everett Zufelt CreditAttribution: Everett Zufelt commentedI think this needs more review before it is RTBC. I know I haven't had an opportunity to look at the patch, and many others may want / need to chime in first, including those involved in the D8 gates (should any apply). Let's give it a few days for some of us to have time to review.
Comment #7
Gábor Hojtsy@Everett: This merely moves code from a template file to the PHP module file, where it should theoretically be by definition anyway. There is no change involved otherwise, it is just a small cleanup. I think its fine to commit as-is.
Comment #8
JacineNice cleanup! Looks good to me too.
Comment #9
sunLet's use #attached on the form here, including 'tabledrag'. Ideally also merge the 'css' line into it.
We should also try to backport this.
Comment #10
skottler CreditAttribution: skottler commentedsun, do you think that should be a separate issue, it seems to me that since there is a commitable patch here, we can do the render change in a seperate issue. I'm in favor of backporting and will roll patches for 6 and 7.
Comment #11
sunLet's do it in this issue. Although I added the tag myself, I'm not sure whether this can be backported.
Comment #12
aspilicious CreditAttribution: aspilicious commentedNo idea how to handle the suggestions. Anyone? I can roll if I get instructions.
Comment #13
sunThis should (hopefully) work.
Comment #14
aspilicious CreditAttribution: aspilicious commentedIt doesn't
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'tabledrag' not found or invalid function name in drupal_process_attached() (line 4498 of C:\xampp\htdocs\drupal8\core\includes\common.inc).
And I'm not sure the css gets loaded
Comment #15
sunoopsie, yeah, 'tabledrag' needs to be 'drupal_add_tabledrag'.
The short form is only supported for 'css', 'js', and 'library'.
Comment #16
aspilicious CreditAttribution: aspilicious commentedHmm, dragging in the disabled region does some funky things.
I think there is a problem with #attached and multiple tabledrag's.
I maybe have seen an issue somewhere... Can't find it :(
Comment #18
aspilicious CreditAttribution: aspilicious commentedComment #19
aspilicious CreditAttribution: aspilicious commentedOk, to see what doesn't work:
1) apply the patch
2) go to structure ==> blocks
3) go to disabled blocks area and try to drag it to the top
You'll see that you can drag but when you let go you get some funky results. It feels like the "end drop" doesn't get triggered somehow.
Comment #20
JacineOuch. Let's try to figure out what's going on here. Tagging.
Comment #21
sunGosh, that took some time to figure out.
Comment #22
tim.plunkettIf this is always set, can we just do
array(BLOCK_REGION_NONE => t('Disabled'))
and kill off those 3 lines in template_preprocess_block_admin_display_form?Otherwise, this is the same conclusion I *just* came to during the HTML5 sprint.
Comment #23
tim.plunkettWhoops.
Comment #24
sunAlthough I agree that it's very wonky, I intentionally did not want to open that can of worms. This form is re-used by the Dashboard module, which is one of the primary reasons for it being so wack.
Comment #25
JacineThis one is ready. tim.plunkett was working on the patch in the last HMTL5 meeting as we were discussing the problem, and was about to post the exact same patch.
Comment #26
Dries CreditAttribution: Dries commentedCommitted to 8.x. Moving to 7.x. Thanks all.
Comment #27
webchickUhhh. Is this actually backportable? If someone already has a copy of block-admin-display-form.tpl.php in their theme, don't they end up with two table headers?
Comment #28
aspilicious CreditAttribution: aspilicious commentedNot rly two table headers but the css/jss gets loaded multiple times and I'm not sure thats a good thing. AND this is not broken in drupal7 it's just a D8 cleanup, so I don't think it's a good idea to backport this.
Marking fixed.
Comment #29
webchickCool; restoring old properties.
Comment #30
JacineThanks! Removing the sprint tag.