Problem/Motivation

Using PHP 5.2.17 and Drupal 6.22. After successfully configuring the module, the settings page (admin/settings/webform2vtiger) won't show VTiger required fields and Drupal will throw this message "htmlspecialchars() expects parameter 1 to be string, array given en /var/www/ee_drupal/ww2.entornos.com.ar/includes/bootstrap.inc en la línea 856".

Proposed resolution

A quick fix could be removing the call to check_plain() on line 77 ($form['field_required']['webform2vtiger_required_fields'] array block). But this might cause some security treat. So what I did was adding a foreach before this block:

  /**
   * Fix for using check_plain() on 'webfor2tiger_required_fields'.
   */
  $webform2vtiger_available_fields = variable_get('webform2vtiger_available_fields', array());
  foreach($webform2vtiger_available_fields as $key => $value) {
    $webform2vtiger_available_fields[$key] = check_plain($value);
  }

And then changing:

  check_plain(variable_get('webform2vtiger_available_fields', array()))

To:

  $webform2vtiger_available_fields

Remaining tasks

This might need some further testing.

Comments

Robertas’s picture

Assigned: Unassigned » Robertas
Status: Active » Closed (fixed)

Thank you for your submit. This error was fixed in a release version webform2vtiger 6.x-1.0
Please download latest version of the module.
Thank you!
Robertas

Robertas’s picture

Issue summary: View changes

Added Drupal version.