When adding a new fieldset and attaching existing fields to it following error is displayed:
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'pid' at row 1: UPDATE {webform_component} SET pid=:db_update_placeholder_0, form_key=:db_update_placeholder_1, name=:db_update_placeholder_2, type=:db_update_placeholder_3, value=:db_update_placeholder_4, extra=:db_update_placeholder_5, mandatory=:db_update_placeholder_6, weight=:db_update_placeholder_7 WHERE (nid = :db_condition_placeholder_0) AND (cid = :db_condition_placeholder_1) ; Array ( [:db_update_placeholder_0] => [:db_update_placeholder_1] => name [:db_update_placeholder_2] => Name [:db_update_placeholder_3] => textfield [:db_update_placeholder_4] => [:db_update_placeholder_5] => a:14:{s:13:"title_display";s:6:"before";s:8:"disabled";i:0;s:6:"unique";i:0;s:20:"conditional_operator";s:1:"=";s:5:"width";s:0:"";s:9:"maxlength";s:0:"";s:12:"field_prefix";s:0:"";s:12:"field_suffix";s:0:"";s:11:"description";s:0:"";s:10:"attributes";a:0:{}s:21:"conditional_component";s:0:"";s:18:"conditional_values";s:0:"";s:18:"translated_strings";a:1:{i:0;s:19:"webform:18:1:#title";}s:7:"private";b:0;} [:db_update_placeholder_6] => 1 [:db_update_placeholder_7] => 22 [:db_condition_placeholder_0] => 18 [:db_condition_placeholder_1] => 1 ) in webform_component_update() (Zeile 802 von /...//httpdocs/sites/all/modules/webform/includes/webform.components.inc).

If no other fileds are attached everything works fine. Same if the fields are attached later.

Using latest dev + Webform Localization.

Comments

quicksketch’s picture

Interesting, thanks for the report. Webform doesn't allow you to change the order of fields and add a field at the same time, so even if you could add the field it wouldn't nest the children under the fieldset at the same time as adding it. We should prevent nesting fields under a fieldset at the time a field is being added. It especially doesn't make any sense that you could actually do the same thing for any field type (such as trying to put elements under textfield).

DeNelo’s picture

Got it too. After creating a fieldset, I get this error on save if I move the fieldset.
But I'm on 7.x-4.0-alpha6!

honza pobořil’s picture

Version: 7.x-3.x-dev » 7.x-4.0-beta3

Still happens in the newest branch

jjmackow’s picture

I've found a similar issue, but mine regards the 'mandatory' flag that get's set within the webform_component_update() function in webform.components.inc.
at issue was that the $component array didn't have the 'mandatory' value set, but hte database was expecting a boolean value.
I've altered line 813 to the following:
$component['mandatory'] = isset($component['mandatory']) ? (is_nan($component['mandatory']) ? round($component['mandatory']%2,0, PHP_ROUND_HALF_DOWN): 0) : 0;

at least to ensure that a boolean value is actually passed. When I tested, a value of '' was being passed and tossing the PDOException.

danchadwick’s picture

Version: 7.x-4.0-beta3 » 7.x-4.x-dev

  • DanChadwick committed a3e70fd on 7.x-4.x
    Issue #1506208 by DanChadwick: Fixed allowing fields to be indented...
  • DanChadwick committed 8214559 on 8.x-4.x
    Issue #1506208 by DanChadwick: Fixed allowing fields to be indented...
danchadwick’s picture

Status: Active » Fixed
StatusFileSize
new1.18 KB

@jjmackow -- You have an entirely different issue, resulting from a problem with a webform update. There is an update that rename the required field to mandatory (or vice versa, don't recall at the moment). It has nothing to do with fieldsets.

I have reproduced this issue with 7.x-4.x-rc6 as follows.

Drag a field indented under the New Component placeholder. Click Save. It attempts to indent the item under the placeholder.

This happens when you create a new Fieldset somewhere in the form. This leaves the New Component placeholder under it. You then drag a field (or fields) under what you think is the Fieldset, but is really the New Component placeholder. This creates the same problem.

Tabledrag has the ability to specify that rows must be a leaf -- i.e. nothing nested under them. That's what the New Component placeholder needs.

Committed to 7.x-4.x and 8.x

Status: Fixed » Closed (fixed)

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