Notice: unserialize() [function.unserialize]: Error at offset 0 of 1 bytes in pollfield_field_widget_form() (line 340 of /home/u4586/domains/dev.yogalife.by/sites/all/modules/pollfield/pollfield.module).
Notice: Undefined property: stdClass::$nid in pollfield_field_widget_form() (line 344 of /home/u4586/domains/dev.yogalife.by/sites/all/modules/pollfield/pollfield.module).
Notice: Undefined property: stdClass::$field_blog_poll in pollfield_field_widget_form() (line 355 of /home/u4586/domains/dev.yogalife.by/sites/all/modules/pollfield/pollfield.module).
Warning: Invalid argument supplied for foreach() in pollfield_field_widget_form() (line 355 of /home/u4586/domains/dev.yogalife.by/sites/all/modules/pollfield/pollfield.module).
Notice: Undefined variable: field_lang in pollfield_field_widget_form() (line 358 of /home/u4586/domains/dev.yogalife.by/sites/all/modules/pollfield/pollfield.module).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

javalxs’s picture

I have the same error messages.help me!

Aalandriel’s picture

I think it needs some kind of check to see if the node has been saved before running the code in line ~340-358. As it appears these warnings/notices appear because the node has not yet been saved.

UksusoFF’s picture

same errors? anybody have solution?

BeaPower’s picture

same errors...

Taxoman’s picture

Priority: Normal » Critical
itarato’s picture

Same warnings. I created a new content type. Added the pollfield field. Then on the first setting screen I clicked submit, and on the second screen I got the messages.

dmitrit’s picture

FileSize
20.76 KB

Fixed some bugs and style issues, but code should be tested more, sorry. I guess there is another bugs.

Andi-D’s picture

Same Warning her,

Used Modul Version from #7

Now I have the problem at saving the content:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0='field_pollfield_votes', 1='1' WHERE (entity_id = '14') AND (delta = '0')' at line 1: UPDATE {field_revision_field_pollfield} SET 0=:db_update_placeholder_0, 1=:db_update_placeholder_1 WHERE (entity_id = :db_condition_placeholder_0) AND (delta = :db_condition_placeholder_1) ; Array ( [:db_update_placeholder_0] => field_pollfield_votes [:db_update_placeholder_1] => 1 [:db_condition_placeholder_0] => 14 [:db_condition_placeholder_1] => 0 ) in pollfield_save_choice() (line 587 pollfield.module).

I think it is the same Problem from issue
http://drupal.org/node/1615404

dmitrit’s picture

FileSize
20.41 KB

Yes, right. I fixed more bugs. New version attached.

dmitrit’s picture

Title: Erros on node create page » Errors on node create page
Status: Active » Needs review
FileSize
19.95 KB

Fixed many bugs, added support for EntityFieldQuery, coding style issues etc.

scud’s picture

Thanks for the bugfixes! Unfortunately I still can't save my poll field setup. I now have this error:

Notice: Undefined index: #node in pollfield_field_widget_form() (line 278

The code in question is the pollfield_field_widget_form, where it calls $node = $form['#node'];.
I did a quick print_r, and I cannot seem to see the index in the $form array. I think this is SO close to being finished, but I don't know enough about this to fix it, or I would have posted my "patch".

cesargad’s picture

FileSize
11.56 KB

Hola, he corregido varios (muchos) errores de este módulo en su versión 7.x-2.x-dev. No me acuerdo realmente que errores eran, pero el mensaje que indican (PDOException: SQLSTATE[42000]) me salía al votar, al crear nodo y en otros sitios donde había que guardar información. Ya que estoy implementando un site real, pues me he visto en la necesidad de corregir varios errores. Estoy trabajando con votación por cookies y ya me funciona bien. Subo el archivo para ver si a ustedes les funciona bien. He tratado en lo posible de no afectar el resto de la funcionalidad del módulo. Disculpen, por los echos y los dvm, que me ha servido para probar la votación como anónimo y como logueado.

cesargad’s picture

Complemento información sobre las correcciones hechas:

  • Corrección de error SQLSTATE[42000] en algunos tipos de votaciones. En general se corrigieron todas las instrucciones SQL que estaban en formato D6, pasándolas a D7. Con esto ya pudo habilitar completamente la cancelación de votos y la votación
  • Unserializado de valores por defecto para los formularios de edición de propiedades del campo pollfield del nodo.
  • Corrección de la generación de cookies para votación por cookies. Esto permite ahora la cancelación de votos.
  • Corrección del guardado de configuración 'result_allow' (Permitir ver los resultados sin haber votado). También se creó la variable $_result_allow que estaba siendo confundido por $_cancelvote
  • Se corrigió el establecimiento de la configuración de 'poll_type' (tipo de votación), la cuál hacía referencia a una variable inexistente $poll_type.
  • Se corrigió el cálculo de número de opciones en el formulario de configuración de campo pollfield, lo que hacía que se vieran sólo 3 opciones.
  • Se corrigió parcialmente la acumulación de opciones en blanco, que al parecer no está eliminando automáticamente.
  • Se corrigió el INSERT INTO de votación por ip y la anónima.

No se ha corregido:

  • Botón de añadir opciones en la configuración por defecto del campo pollfield. Pero existe la posibilidad de añadir más opciones llenando la opción que aparecen en blanco, al final, y haciendo click en guardar, y así sucesivamente para añadir mas opciones.
  • En algunos casos el recuento no es exacto, parece que esto sucede cuando no se registra bien los votos.
  • En algunas ocasiones la votación se establece como cerrado, sin que nadie lo haya configurado de esa manera.
Helge’s picture

After the last dmitrit patch i have a new error:

Warning: Illegal string offset 'en' in pollfield_field_widget_form() (line 408 of H:\xampp\htdocs\bj7\sites\all\modules\pollfield\pollfield.module).

Any solutions for that?

Oleksa-1’s picture

Title: Errors on node create page » Pollfield 7.x-2.x-dev with support for EntityFieldQuery and bug fixes
FileSize
20.59 KB

Fixed in #10
- Notice: Undefined index: #node in pollfield_field_widget_form() (line 278
- Strict warning: Creating default object from empty value in pollfield_vote()
new version attached

@Helge I can not reproduce your error on my localhost pls try latest ver and feedback

jazzitup’s picture

@Oleksa: Now Poll Type can NOT be single choice. Try to set "single choice" as the default. Won't work.

jazzitup’s picture

This is an error message from my logs (after a successful cron):

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'NODE.CREATED' in 'where clause': 

SELECT 
	field_data_field_poll0.entity_type AS entity_type, 
	field_data_field_poll0.entity_id AS entity_id, 
	field_data_field_poll0.revision_id AS revision_id, 
	field_data_field_poll0.bundle AS bundle 
FROM {field_data_field_poll} field_data_field_poll0 
	INNER JOIN {field_data_field_poll} field_data_field_poll1 
		ON 
			field_data_field_poll1.entity_type = field_data_field_poll0.entity_type 
			AND field_data_field_poll1.entity_id = field_data_field_poll0.entity_id 
	INNER JOIN {field_data_field_poll} field_data_field_poll2 
		ON 
			field_data_field_poll2.entity_type = field_data_field_poll0.entity_type 
			AND field_data_field_poll2.entity_id = field_data_field_poll0.entity_id 
	INNER JOIN {node} node 
		ON 
			node.nid = field_data_field_poll0.entity_id 
WHERE 
	(field_data_field_poll0.field_poll_runtime <> :db_condition_placeholder_0) 
	AND (field_data_field_poll1.field_poll_runtime + NODE.CREATED < :db_condition_placeholder_1) 
	AND (field_data_field_poll2.field_poll_active = :db_condition_placeholder_2) 
	AND (field_data_field_poll0.deleted = :db_condition_placeholder_3) 
	AND (node.status = :db_condition_placeholder_4) 
	AND (field_data_field_poll0.entity_type = :db_condition_placeholder_5); 

Array ( 
	[:db_condition_placeholder_0] => 0 
	[:db_condition_placeholder_1] => 1357243723 
	[:db_condition_placeholder_2] => 1 
	[:db_condition_placeholder_3] => 0 
	[:db_condition_placeholder_4] => 1 
	[:db_condition_placeholder_5] => node 
) 

in field_sql_storage_field_storage_query() (line 582 of /home/user/public_html/modules/field/modules/field_sql_storage/field_sql_storage.module).

Which refers to Line 1437:

    $query->entityCondition('entity_type', 'node')
      ->fieldCondition($field_name, 'runtime', 0, '!=')
      ->fieldCondition($field_name, 'runtime', $time, '+ node.created <') // Unknown column 'NODE.CREATED'?
      ->fieldCondition($field_name, 'active', 1, '=')
      ->propertyCondition('status', 1);
jazzitup’s picture

The above happens in each cron run.

The problem seems to be with an illegal operator. Unfortunately, you can't use an expression '+ node.created <' as an $operator according to the current API!

jazzitup’s picture

I can reproduce #14 (@Helge, it's not an error, it's just a warning!), even after I installed the module from #15. The issue appears after I save the node and then visit its edit page. My server runs PHP 5.4.

You need to surround a key value in {} because it's a dynamically-assigned variable.

Instead of:

        if (isset($node->$field_name[$language->language])) {
          $field_lang = $node->$field_name[$language->language];
        }

You should use:

        if (isset($node->{$field_name}[$language->language])) {
          $field_lang = $node->{$field_name}[$language->language];
        }

pollfield.module line 412.

jazzitup’s picture

Summarizing all issues from this thread inside of a working patch against the latest 7.x-2.x-dev.

klonos’s picture

The persistence and work in this issue despite the fact that this project seems to be abandoned is amazing! Good on ya people ;)

I'm posting this merely to let you know that the core poll.module was removed from Drupal 8: #61285: Remove poll module from core

So, the whole thing was moved to contirb: Poll (from core)

In #1266336: Modernize Poll module (this issue was originally filed against D8 core, but was moved over to Poll (from core)) there's a mention of Pollfield and it seems that there's thought of moving on the same logic as this module. So, unless someone takes over this project here to bring it back to life (#1935158: Pollfield still being maintained?), I'd suggest to merge efforts with Poll (from core).

Just a heads up ;)

proweb.ua’s picture

in #15

Notice: unserialize() [function.unserialize]: Error at offset 0 of 1 bytes в theme_pollfield_default_formatter() (line 961 із /var/www/**/***/public_html/sites/all/modules/pollfield/pollfield.module).

tiikeri’s picture

For me #15 works fine, many thanks ;)

tiikeri’s picture

Issue summary: View changes

Updated issue summary.

alesel’s picture

what is with the cron problem? Are there any solutions?

tiikeri’s picture

Issue summary: View changes

Hi alesel, I got the same problem running cron which cause a PDOException as reported in #17, after update the last dev version of the module. But it was my fault: i manually update the module and forgot to run update.php

To fix the error: update the module to the last release for d7 https://drupal.org/project/pollfield (at time of writing 01 October 2013, version 7.x-2.x) and run update.php in Mantainence mode. Don't forget to put the site in mantainance mode, or you will run into another error.

No changes will be made to database, anyway this worked for me. Hope it will help you too.

alesel’s picture

tiikeri, many thanks ;)

bbujisic’s picture

Status: Needs review » Fixed

Jazzitup, this comment comes two years too late, but better late than never. Thanks heaps for your patch.

Time to close the issue.

jazzitup’s picture

@Branislav: You're welcome (služimo narodu)! :)

Status: Fixed » Closed (fixed)

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