Is it possible to change where the webform is printed. If I add fields to the webform content type, it prints the webform as the very last element on the node. Also to be able to do this without going into a template file.

Comments

quicksketch’s picture

Title: Is it possible to change the order of where the form is printed » Implement hook_field_extra_fields() for D7
Category: support » feature

I thought we had already done this, but I'm guessing that our implementation was broken by a change in Drupal 7 at some point. This is possible in D6 through this feature: #598714: Implement hook_content_extra_fields(), but apparently the equivalent hook (hook_field_extra_fields) is not implemented correctly in Webform for Drupal 7.

pwaterz’s picture

I will take a look tomorrow and try and submit a patch.

pwaterz’s picture

StatusFileSize
new894 bytes

here is my patch

quicksketch’s picture

Status: Active » Needs work

Looks like this patch still has a bit of code probably copied from poll.module:

+      'choice_wrapper' => array(

Shouldn't that just be "webform"?

pwaterz’s picture

StatusFileSize
new890 bytes

woops here yea go.

swentel’s picture

There's another older patch at #1040834: Refactor webform_field_extra_fields() - have marked it as duplicate now.

I'm not sure if the 'form' is needed, because I don't think it does anything right ?

quicksketch’s picture

I'm not sure if the 'form' is needed, because I don't think it does anything right ?

A good point swentel, I think we can remove that since Webform doesn't add anything to the node form.

pwaterz’s picture

StatusFileSize
new668 bytes

make sense here is the revised patch.DONT USE THIS ONE. Php error

pwaterz’s picture

StatusFileSize
new700 bytes

Use this one.

quicksketch’s picture

Status: Needs work » Fixed
StatusFileSize
new947 bytes

Thanks pwaterz, I've committed this simplified patch plus removing some legacy code that should no longer be necessary regarding field weights.

pwaterz’s picture

sweet!

Status: Fixed » Closed (fixed)

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