chx mentioned in drupal-devel:
If someone is bored and want to code something, there is core work to do before we can go RC: custom block and comment uses filter_form. Thus their save routines need to be changed to the form execute model otherwise they won't work in some cases.

Attached is my attempt to convert block_box_add and block_admin_configure to the formsapi execute model.

Comments

asimmonds’s picture

Status: Needs review » Needs work

Further tests show that I haven't got the error handling completely correct.

asimmonds’s picture

Status: Needs work » Needs review
StatusFileSize
new9.71 KB

Update attached with form validation.

asimmonds’s picture

This patch also fixes a typo that results in a infinite loop from the form api when admin/block/configure/* is viewed
(http://drupal.org/node/35682)

drewish’s picture

humm, i can't get that patch to apply to HEAD. it may be on my end, patch is failing with an error that i'm not used to.

asimmonds’s picture

drewish:
No use complaining about getting a error with this patch if you don't say what the error is, so you could be helped to fix it.

So what's the error you get?

drewish’s picture

asimmonds, I hardly think I was complaining. I simply pointed out that it didn't work for me but that the fault was probably mine. I didn't really want to turn it into a "help me debug patch" thread. But, since you asked ;) the error, using GNU patch 2.5.9 on Windows, is:

D:\kpsu\drupal\modules>patch < block-admin-form-execute_0.patch
patching file block.module
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 340

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I've used it successfully on other patches but I've never seen that error.

asimmonds’s picture

Sorry for sounding a little bit abrupt, 6am was a little early for me and I suppose it's a little of topic but no one else is reviewing this patch.

The problem with that version of patch is that it doesn't like patches with unix-style line-endings(LF). If you convert the patch to one with DOS/Windows style line-endings (CR/LF), it will work. You can convert it with any decent texteditor or command line utility like unix2dos.
I use the cygwin suite of tools under windows, and don't really get problems like this.

chx’s picture

That's no Drupal error and has nothing to do with the patch.

drewish’s picture

asimmonds, no worries. Thanks for the tip, I was hoping it was something simple like that.

asimmonds’s picture

StatusFileSize
new9.9 KB

Re-roll patch for current HEAD.

asimmonds’s picture

StatusFileSize
new11.63 KB

Some code cleanups and fix the bug with individual theme block settings.

drewish’s picture

StatusFileSize
new11.74 KB

as noted in another bug, there's still a problem changing the block settings for a theme other than the user's. the problem is that up in block_menu() it makes the system's theme the default task. the form, on the other hand, uses the user's theme as the default.

i've made a small change to asimmonds patch to fix this.

chx’s picture

Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new11.44 KB

Why this patch is needed? Because filter now uses #value for single case and simply old style block configure won't work in this case -- there is no format in POST edit. Therefore I deem this critical.

Rerolled.

drewish’s picture

chx's re-roll looks good to me. can we get this committed?

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)