Node body doesn't display at the first preview but appear at next ones.

I've found out that this issue appear as soon as the core Locale module is enabled. My little investigation found out that the node preview process build the resulting body under $node->body[en] and for some reasons, when the anonymous_posting module create instance of its field, this issue is triggered.

Comments

drikc’s picture

Status: Active » Fixed

Fixed by using hook_field_validate() in place of a custom validation function.

It appear that, in the custom validation function, using field_get_items() trigger this issue:

function anonymous_posting_field_anonymous_author_widget_form_validate($element, &$form_state) {
  $fields = current(field_get_items($element['#entity_type'], (object) $form_state['values'], ANONYMOUS_POSTING_FIELD_NAME));
  ...

Then using hook_field_validate() permit to retrieve the anonymous_posting field columns cleanly without using field_get_items().

drikc’s picture

Oh this concern 7.x version

Status: Fixed » Closed (fixed)

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