Issue
With the Webform Localization module, you can choose to use a single webform across all translated copies of a webform. This causes PHP errors with Webform Classes when a translated copy of a webform node is viewed, as webform_classes_form_alter() just uses the nid from the form's #id attribute to apply classes.

Proposed solution
In webform_classes_form_alter(), check if the Webform Localization module is enabled, if so, attempt to look up the localization configuration for the webform node's tnid. If such configuration exists AND the source node has been configured to use a single webform, use the source node's NID and webform classes instead.

Comments

Scott Robertson’s picture

Status: Active » Needs review
StatusFileSize
new1.78 KB

A patch is attached for the proposed solution.

Status: Needs review » Needs work

The last submitted patch, 1: webform_classes-webform-localization-support-2340129-1.patch, failed testing.

Scott Robertson’s picture

Status: Needs work » Needs review
StatusFileSize
new1.24 KB

Fixed patch for automated testing.

Scott Robertson’s picture

Title: Weborm Localization Support » Webform Localization Support

devd’s picture

Version: 7.x-2.1 » 7.x-2.2
Status: Needs review » Closed (fixed)

Thanks Robertson.