After some digging/testing I noticed that this happens when the validation is triggered by #element_validate, not form's validate function (editableviews_entity_form_validate).

Steps to reproduce:

1. Create an entity with a number field

2. Create a view with editable views adding the number field created in step 1 as an editable field and select "Hide widget label".

3. Try to submit the form with invalid characters in the number field (for example instead of a number try typing "test").

In the Validation message you will see something like:
"Only numbers are allowed in ."

Although it should be
"Only numbers are allowed in [Field's Label]."

Reason:
Overwriting field label as done in line 115 of editableviews_handler_field_field_edit.inc is not correct.

    if (!empty($this->options['suppress_label'])) {
      $field_instance['label'] = '';
    }

That causes the field_instance to not have a label at all, and although it gets the job done, it messes with the field.

Proposed Solution:
Another way (and I think the proper one) to hide field's label using the form API is to add the '#title_display' directive in the final field, after its creation.

https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...

e.g.
$element_widget['#title_display'] = 'invisible';

Comments

Zekvyrin created an issue.

Zekvyrin’s picture

I've tested a little bit and I could do it in my case (number and text fields) by adding this line:

$element[$field_name][LANGUAGE_NONE][0]['value']['#title_display'] = 'invisible';

directly after element creation (line 151)

$element += (array) ctools_field_invoke_field ...

But I couldn't find any generic solution as I couldn't determine how exactly the widget would be nested (maybe I'm forgeting a drupal function that might return what is needed).
For example, my code wasn't working for term_reference fields, thus I didn't submit any patch...