Summary:
If you have a Webform configured to use Localization by string translation and have a markup component, refreshing the webform localization strings creates error messages in the watchdog.

Steps to reproduce:

On a clean install of D7.42:

drush -y dl webform_localization-7.x-4.x-dev i18n
drush en -y webform webform_localization
Add a new webform.
Add a markup field.
Go to form settings, tick " Expose webform component strings suitable for translation." under "Localization by string translation"
Go to admin/config/regional/translate/i18n_string
Check 'webform localization' and press Refresh Strings
Go to admin/reports/dblog

Actual Result:
Two errors are logged:
* WebformConditionals::componentMarkup called prior to evaluating a submission.
* Undefined index: page_num in _webform_display_markup() (line 156 of /Volumes/www/DevDesktopSites/d7419/drupal-7.42/sites/all/modules/webform/components/markup.inc).

Expected Result:
No errors should be in the watchdog.

CommentFileSizeAuthor
#2 2671042-02.patch1.4 KBnicrodgers

Comments

nicrodgers created an issue. See original summary.

nicrodgers’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new1.4 KB

This patch is based on the one in 2542796, but updated to work within _webform_display_component/_webform_display_markup.

nicrodgers’s picture

Status: Reviewed & tested by the community » Needs review

Selected wrong status.

nicrodgers’s picture

danchadwick’s picture

Status: Needs review » Needs work

This don't seem like the right place to fix this. The root problem is the caching. I'm not sure how localization fits into this, but can't it handle this case?

RAWDESK’s picture

Hi, just to confirm this patch also fixed the error from occurring on a drush fra in post deploy commands.
Our webform was featured with webform_feature module and gathered some additional translation settings during deploy :

  'translations' => array(
    'original' => 'und',
    'data' => array(
      'und' => array(
        'entity_type' => 'node',
        'entity_id' => 7,
        'revision_id' => 7,
        'language' => 'und',
        'source' => '',
        'uid' => 1,
        'status' => 1,
        'translate' => 0,
        'created' => 1478530481,
        'changed' => 1478530481,
      ),
    ),
  ),
giupenni’s picture

#2 works for me

abaier’s picture

#2 solved this problem for us too. Thanks!

liam morland’s picture

Status: Needs work » Closed (outdated)

Drupal 7 is no longer supported. If this applies to a supported version, please re-open.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.