Could the Block Title Link fieldset could be shown on the block add form as well? Currently, two steps are required to create a block with a title link.

Comments

ngmaloney’s picture

Assigned: Unassigned » ngmaloney
Status: Active » Fixed

It looks like the $form_id change from D6 to D7 on the block add form. Latest commit resolves.

star-szr’s picture

Thanks, I see the fieldset now on the block add form but submitting the form does not save the Block Title Link data. I had already tried just adding the $form_id to the condition as you have done, should have mentioned that.

ngmaloney’s picture

Status: Fixed » Needs work

@Cottser - I noticed that when testing yesterday. It looks like the cause is the submit handler doesn't yet have the block's delta. I'm looking how other modules (menu block) solve this problem and hope to roll a patch ASAP. If you can think of a method for solving this problem please feel free to post some code.

star-szr’s picture

It looks like menu block uses hook_block_save() rather than attaching a submit handler.

ngmaloney’s picture

awesome. thanks for taking a look. I should be able to roll a patch sometime soon.

EDIT: This patch is taking longer than anticipated. It is actively being worked on, however.

star-szr’s picture

Anything in progress I can help with?

ngmaloney’s picture

@Cotter I'm having trouble using hook_block_save(). My understanding is it requires hook_block_configure() for generating the form. According to a comment in the docs, hook_block_configure can ONLY change blocks created by the module it is declared in. Menu Block can use this method as it is only altering blocks created by menu block.

I'm trying to find a way to have the submit handler triggered after the block is saved and then pass in the block id in the form_state variable. I can't seem to find any modules that do this. If you could locate a module that does this (or a code snippet) that would be a big help.

ngmaloney’s picture

Status: Needs work » Fixed

Version 7.x-1.2 contains fix.

star-szr’s picture

Looks good, thanks!

Status: Fixed » Closed (fixed)

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