ife doesn't work with node add/edit form.

Here is my settings page:
ife Settings

Here is node form
node form

Notice that error messages for required fiels are at the top of the page.

CommentFileSizeAuthor
Selection_113.png29.48 KBa.milkovsky
Selection_112.png14.98 KBa.milkovsky

Comments

a.milkovsky’s picture

Priority: Normal » Major

I think this is major feature

a.milkovsky’s picture

I debugged a little. Validation is not triggered when there is element with '#reqiured' => TRUE attribute on the form.

stijndm’s picture

This should work without any issues.
Can you try the dev version?

stijndm’s picture

Could you try setting the display option to default and setting the general settings to show an alternate message. The bug might be related to the individual display override.

stijndm’s picture

Status: Active » Postponed (maintainer needs more info)
a.milkovsky’s picture

I tried on clean installation with Drupal 7.26 and 7.28 everything works. I will try to make more tests. Maybe there is some module that causes conflicts.

a.milkovsky’s picture

Status: Postponed (maintainer needs more info) » Active

The module conflicts with the More buttons mb_content submodule module
Because of the line 274 in mb_content.module:
$form['actions']['submit']['#validate'][] = 'mb_content_changed_validate';
When I comment it everything works fine.

Do you think it's a problem of the mb module?

martichka5’s picture

I face the same problem.
Enable the module for my content type node form and it does not work. All error messages appear on the top as usual without the General error message. But the most strange is that is working for the multiple field collection fields i have on the same form.
This is with the latest dev version of the module.
I do not use mb module.

Any ideas?
Thanks in advance!

martichka5’s picture

Hi, again.

The problem was with the Workflow module.
Workflow buttons that are clicked to submit the node form have only its validation function and do not execute the Ife validator.
So, i alter all Workflow buttons to have the ife validation function.
It works now.

May be it will be helpful for someone with the same case.

vj’s picture

@martichka5

Can you please share the code ??
I am also facing the issue for file upload max size. If i upload image with greater size it shows error at the top instead of after form element.

alansaviolobo’s picture

this should help in resolving the conflict with workflow.module



/**
 * Implements hook_form_alter().
 */
function HOOK_form_alter(&$form, &$form_state, $form_id) {
  foreach ($form['actions'] as $id => &$button) {
    if ($id == '#type') {
      continue;
    }
    if (substr($id, 0, 8) == 'workflow') {
      $button['#validate'][] = 'ife_form_validator';
    }
  }
}