Can we remove the feedback form from printing in the page footer please? If we can add it as a block to our own footer, isn't that enough. I'm currently getting validation issues because of multiple items with the same id.
I propose just delete the feedback_footer function altogether? Or should there be a flag on a config page?

Comments

sun’s picture

Category: bug » task

hook_footer() has the benefit of being region-independent. So Feedback may also be displayed on pages that do not output the region the block was placed in.

However, the current implementation does not allow to use the block at all.

To make this work, we have to move the invocation of drupal_get_form() into a separate function, f.e. feedback_output(), and set a static flag that indicates whether the feedback form has already been output. Both in hook_block() and in hook_footer(), we call this function instead, and if does not return something, nothing is output in the corresponding hook implementation.

Rosamunda’s picture

subscribing

mdupont’s picture

At least the id should be converted to a class, since as soon as one adds a block for the feedback form, one gets 2 elements with the same id.

kabadayi’s picture

I m trying to replace feedback as block somewhere on the right side by removing it printing from the page footer, since i m not expertised with these codes can anyone please explain it step by step and clearly and tell me where do i apply this changes.

thanks in advance

adamo’s picture

@kabadayi:

Just to into Site Building -> Blocks, and place the Feedback block in whatever region you want. Then, edit your theme's CSS, and do something like this:

  /* Feedback module */
  div#block-feedback-form
  {
    position: relative;
    top: 0px;
    right: 0px;
  }

That should get it in your block. You will probably need to style it further to get the widths of everything in the feedback form to fit within sidebar or wherever you're putting it.

kabadayi’s picture

Thanks for the reply but i already tried editing theme's CSS and well it worked but the feedback is still showing up in different places when i use different browser or other resolution. So i reckon i should do some other changes which prevent this module printing on the footer and allows me use it as a block.

muddum’s picture

I am also having the issues mentioned above; if I add a block/move feedback block to another region I get a duplicate block in the footer as well - with the same ids and classes so I cannot hide the "bad" one. If I try just moving the footer via css e.g.

div#block-feedback-form {
position: relative; /* was fixed*/
width: 220px; /* added this 220 wide*/
bottom: 203px;
/*left: 800px; /changed to left and 800*/
overflow: hidden;
z-index: 10;
}

Then I get horrific xbrowser issues so things are unworkable. It would be great to have a mechanism that allowed more flexibility - if I get something going I will submit. Otherwise seems to work nicely...

muddum’s picture

Category: task » support

It would be great if you could elaborate in more detail (a code example) on how to implement your suggestions:
"move the invocation of drupal_get_form() into a separate function, e.g. feedback_output(), and set a static flag that indicates whether the feedback form has already been output. Then, in hook_block() and in hook_footer(), call feedback_output() instead, if does not return something, don't output in the corresponding hook function."

Thanks in advance.

sleeping_at-work-’s picture

+1

daniels____’s picture

Assigned: Unassigned » daniels____
Status: Active » Needs review
StatusFileSize
new1.17 KB

Sun, I made the changes you said in #1.

Here I roll the patch for 6.x-2.x-dev version.

Can you commit it? Have I change anything?

Thanks in advance.

daniels____’s picture

Issue tags: +feedback, +hook_footer

Sun, I made the changes you said in #1.

Here I roll the patch for 6.x-2.x-dev version.

Can you commit it? Have I change anything?

Thanks in advance.

daniels____’s picture

Sorry, I submited the form two times.

daniels____’s picture

StatusFileSize
new1.17 KB

Oops I attach the patch again.

daniels____’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Category: support » feature

Some changes in Category and Version field of this issue.

daniels____’s picture

Assigned: daniels____ » Unassigned

.

sleeping_at-work-’s picture

tested and... works great!
thanks for the patch

daniels____’s picture

StatusFileSize
new997 bytes

I want to attach the same patch but with more clear code and having used CVS for make it.

daniels____’s picture

StatusFileSize
new1.86 KB

And for our project we have the follow need:

- We don't want feedback in the footer always it is not rendered in a block.

This is caused because we are rendering feedback inside of a Panel using a custom plugin.

So we added an checkbox in a admin settings form that says:

"Show Feedback in footer when block is not used."

I'm not sure this is smart but if you want consider it or if can suggest another solution I will be grateful.

Thanks again.

jody lynn’s picture

Title: Remove from hook_footer » Prevent duplicate feedback forms when placing feedback block
Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Needs review » Needs work

It seems like there are two main options:

- Add a setting to disable the output of the feedback form in the footer region.
- Use a static to force the form to only be displayed once per page.

The first option seems more straight-forward (not doing any magic behind the scenes on people), but requires adding a settings form for only this one setting. May be related to #693880: Alternative UIs/themes as alternate displays also means alternate placements of the form.

jody lynn’s picture

jody lynn’s picture

Status: Needs work » Closed (duplicate)