Hi guys,

At some pages, we get the error below,

Notice: Undefined index: exposed_path en embed_views_form_views_exposed_form_alter() (línea 45 de .../modules/contrib/embed_views/embed_views.module).

This happen because programmer do not ensure this field exists, I supposse this field is not always present.

Maybe some modules working together make this bug, but I am not sure.

Comments

Daniel Royo created an issue. See original summary.

daniroyo’s picture

Issue summary: View changes
grndlvl’s picture

Status: Active » Closed (won't fix)

Daniel,

I believe you might be running a patched version of the module as we have no reference of accessing a "exposed_path" element.

If you would like further assistance please copy the contents of embed_views_form_views_exposed_form_alter() in embed_views.module

Thanks,

Jonathan

daniroyo’s picture

Yes, you are right Jonathan,

I paste here the content for references in the future.

/**
* Implementation of hook_form_FORM_ID_alter().
*/
function embed_views_form_views_exposed_form_alter(&$form, &$form_state) {
  // Change the action of the form for all embed views.
  if ($form_state['display']->display_plugin == 'embed') {
    if($form_state['display']->display_options['exposed_path']){
      $form['#action'] = url(drupal_get_path_alias($form_state['display']->display_options['exposed_path_url']));
    }else{
      $form['#action'] = url(drupal_get_path_alias($_GET['q']));
    }
  }
}
daniroyo’s picture

You are right again John,

I have downloaded the module from the repo, both 2.x dev and 1.x and neither have references to exposed_path :(

Sorry for my interruption, I have this module in contrib modules but somebody put the module incorrectly.

:(

grndlvl’s picture

Daniel,

You will need to check for the existence of "$form_state['display']->display_options['exposed_path']" before using it.

I can only assume that there is yet another module that is introducing that or embed_views has been hacked to introduce that views setting as views core doesn't have that setting.

if (!empty($form_state['display']->display_options['exposed_path'])) {
}

Hope this helps.

Thanks,

Jonathan