I've was just creating an install routine for a site that uses this module and stumbled across a slight hiccup when trying to insert entries into the clientside_validation_settings table. My code is as follows:
$uuids = entity_get_id_by_uuid('node', array('8404b5c1-0214-6be4-7559-c07782e8b00b'));
$clientside_validation_settings = array(
'type' => 'webforms',
'status' => 1,
'form_id' => $uuids['8404b5c1-0214-6be4-7559-c07782e8b00b'],
'settings' => array(
'validate_options_override_default' => 0,
'error_override_default' => 0,
'error_placement_override_default' => 0,
'include_hidden_override_default' => 0,
),
);
drupal_write_record('clientside_validation_settings', $clientside_validation_settings);
However, when this runs, the current hook_schema implementation means that Drupal just inserts an unserialized array into the settings field. To get round it, I could serialize the data myself, but hook_schema() has a parameter which allows you to tell Drupal that a field in your table should contain serialized data. See http://drupal.org/node/146939 for info on the "serialized" boolean parameter.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | clientside_validation-Add-serialize-boolean-parameter-hook_schema-1832478-1.patch | 818 bytes | andymantell |
Comments
Comment #1
andymantell commentedComment #2
andymantell commentedComment #3
attiks commentedThanks, fixed in latest dev version