First off, thanks for the very useful module.

I'm using subforms in a 5.x module and need to strip out the node preview and submit buttons.

It looks like this is easily done in 6.x as the element includes the #form property. For 5.x, though, it's more challenging.

Attached is a draft approach that introduces a new property, #strip_buttons. Not sure whether this would be useful or not in 6.x+. If not, it probably doesn't make sense to add a property this late in 5.x that will just be deprecated.

The alternative I guess is a custom module that registers another #after_build and alters the subform there, but it seems like too small a need to justify another module.

Thoughts?

CommentFileSizeAuthor
subform_element-strip-buttons.patch1.15 KBnedjo

Comments

nedjo’s picture

Status: Active » Needs review
fago’s picture

Status: Needs review » Needs work

sry for the late response.

I like this idea, but unfortunately your patch works only for buttons placed in the top of the form tree or in the element 'buttons'. So if we add something like this, it should work for the whole form tree I think.

Indeed it's quite late for 5.x, so I'd only add improvements that don't touch the core functionality (like your current patch).