Trying to submit a poll in views block:
Location: http://local.123.com/poll/ajax/vote/31366/0/0

undefined variable: _POST in drupal_build_form() (line 283 of C:\Inetpub\wwwroot\andalusiah.com\includes\form.inc).

Any idea?

Comments

quicksketch’s picture

Hm, I don't immediately think this is an issue with AJAX Poll. It sounds like the global $_POST values aren't getting sent or they're getting discarded by PHP. I imagine that the poll doesn't actually save the value?

palamida’s picture

Title: undefined variable: _POST in drupal_build_form() (line 283 o » undefined variable: _POST in drupal_build_form()

I got the same problem after upgrading to Drupal 7.9
Vote results not shown after voting- but after reloading the page my vote (or canceled vote) is perfectly saved.

( Example in Croatian language here: http://test.mojadelta.com/hr/pitanje-broj-1 )

I got this in the log report:
Notice: Undefined variable: _POST in drupal_build_form() (line 297 of /var/www/vhosts/mojadelta.com/httpdocs/includes/form.inc).

tempo22’s picture

I'm having the same problem. Anyone found a solution yet ?

gargsuchi’s picture

same issue - any solution?

ravindersinghsond’s picture

Hello experts,

I am getting same error when I am trying to create a 'Flexible' template of panel layout. When in the "show designer layout" mode and trying to go to "column settings" or "row settings", it throw a window saying "you are not authorize to view this page" and also shows error message "Notice: Undefined variable: _POST in drupal_build_form() (line 309 of C:\wamp\www\mySite".

Any Idea, Plz help

mukesh.agarwal17’s picture

From what it seems the culprit is

unset($_POST);

in the function ajax_poll_callback

Anyone able to solve this?

Alla Tyurina’s picture

Issue summary: View changes
StatusFileSize
new424 bytes

Try this patch.

maximpodorov’s picture

Maybe setting _POST to array() is better.

maximpodorov’s picture

Status: Active » Needs review
StatusFileSize
new427 bytes

The patch which sets $_POST = array().

garbo’s picture

This error still exists.

Drupal 7.43, Ajax poll 7.1.1

legolasbo’s picture

Status: Needs review » Reviewed & tested by the community

This error still exists and the patch still applies.

I've tested it and can confirm that it fixes the error. The patch is straightforward code-wise, so RTBC.

sgdev’s picture

While this is a minor patch, I just wanted to mention I'm running Panels as well as quite a few other modules, and not seeing this error.

I don't think Ajax Poll is the source of the problem.

sgdev’s picture

Update on our situation. We implemented the Authcache module (https://www.drupal.org/project/authcache) on our site, including support for Ajax-based forms, and started seeing this problem. Adding the patch fixed it.

We don't see this issue with Ajax Comments + Authcache, which I assume should be a similar process. We include both options below in Authcache's form token derived from base form id:

poll_view_voting
comment_node_*_form

We also have the Cache Object API module (https://www.drupal.org/project/cacheobject) implemented, which should take care of any issues with Ajax-enabled forms.

So there must be something with Ajax Poll that is a bit different.