Hi,

Last actualization of the Webform Localization (7.x-4.2) module brakes the settings of placeholder in all fields of existing form.
It does not matter whether the placeholder field has value or not - the fields label is displayed as the placeholder all the time.
This is very irritating.

(???)

Comments

Dandys created an issue. See original summary.

joseph.olstad’s picture

this is likely the commit related to this.

Dandys , if you want to change this behavior locally, look at the related patch 39 , remove the 4 lines that were added to webform_localization.module (the lines below with the '+ ' in front.

diff --git a/webform_localization.module b/webform_localization.module
index c41a984..0964934 100644
--- a/webform_localization.module
+++ b/webform_localization.module
@@ -377,6 +377,10 @@ function webform_localization_webform_component_render_alter(&$element, $compone
   if ($wl_options['expose_strings']) {
     module_load_include('inc', 'webform_localization', 'includes/webform_localization.i18n');
     _webform_localization_translate_component($element, $component);
+    if (!empty($element['#title'])) {
+      $name = webform_localization_i18n_string_name($component['nid'], $component['cid'], '#title');
+      $element['#attributes']['placeholder'] = i18n_string($name, $element['#title']);
+    }
   }
 }

I'll do some followup, probably have to check configuration setting first.

Dandys’s picture

Thank you very much for your answer - it works.

joseph.olstad’s picture

Priority: Major » Normal
Status: Active » Needs review
StatusFileSize
new814 bytes

see what testbot says

joseph.olstad’s picture

Patch #4 adds a check for the webform option for placeholder , however I have not yet tested this in my local to see if this option can be turned on or off in webform and whether or not the check is doing what I am hoping.

it passes testbot testing but still needs testing and review.

joseph.olstad’s picture

Dandys , if you want to help me test this, restore the 4 lines of code, then apply patch #4

Dandys’s picture

Hi, joseph.olstad
I have restored this 4 lines of code and applied #4. Module works OK. Thanks.

joseph.olstad’s picture

Nice, thanks for testing. so we can commit this code, I might write an extra simpletest for this use case.

  • joseph.olstad committed b7fa5a7 on 7.x-4.x
    Issue #2633228 by joseph.olstad: Field labels displayed as placeholders
    
joseph.olstad’s picture

Hi Dandys, thanks for the help on this one, next time I'll put your name in the commit log, sorry forgot this time.
Committed fix to dev branch.

joseph.olstad’s picture

Status: Needs review » Fixed

fixed in dev branch, I'll follow up with 7.x-4.3 hopefully in the next few days.

Status: Fixed » Closed (fixed)

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

bluesman2014’s picture

Status: Closed (fixed) » Active

This problem is still current. Any luck with a 7.x-4.3 version?

geertvd’s picture

Status: Active » Needs review
StatusFileSize
new861 bytes

I'm still having this issue also, this fixes it for me.

bluesman2014’s picture

That patch doesn't work for me unfortunately. Titles are still showing as placeholders.

geertvd’s picture

Status: Needs review » Needs work

Yea just noticed myself, apparently it's a bit more complex. I'll see if I can come up with a better patch later today, I feel like we might need to patch webform for this though as placeholders are not marked as #translatable in the component widgets.
Will investigate further.

rodrigoaguilera’s picture

I think this module in an attempt of translating placeholders added the feature of having always a placeholder which is the title of the field or the placeholder.

First it needs to get if there is a placeholder to translate.

balis_m’s picture

I am also having the same issue with @bluesman2014 at 7.x-4.3.

So, i' ve created this patch which fixes the issue and the placeholder translation.

joseph.olstad’s picture

Status: Needs work » Needs review

trigger testbot

joseph.olstad’s picture

Ok, the testbot says its ok, can we get some additional reviews ? I'd like one or two other reviews before committing it.

egontinno’s picture

Patch #18 works for me.

joseph.olstad’s picture

Thanks everyone! committed #18 to dev branch, release to follow.

joseph.olstad’s picture

Status: Needs review » Fixed

see dev branch, or release 7.x-4.4 (to follow)

Status: Fixed » Closed (fixed)

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

joel_osc’s picture

Status: Closed (fixed) » Needs work

This patch has broken progress bar translations due to commenting out the line:

--- a/includes/webform_localization.i18n.inc
+++ b/includes/webform_localization.i18n.inc
@@ -140,7 +140,7 @@ function webform_localization_component_update_translation_strings(&$component)
   // update / create translation source for them.
   $component['extra']['translated_strings'] = _webform_localization_component_translation_parse($element, $component);
   // Render the 'display' FAPI array for the component.
-  $element = webform_component_invoke($component['type'], 'display', $component, NULL, 'html');
+  // $element = webform_component_invoke($component['type'], 'display', $component, NULL, 'html');

With this line commented out refreshing strings no longer picks up the page break labels. I am not sure about any other ramifications yet and whether or not it impacts other components. Can anyone explain why that line was commented out?

joseph.olstad’s picture

joseph.olstad’s picture

joseph.olstad’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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