The following code in asset_form_views_exposed_form_alter() overwrites the #action form property of all Views Exposed Forms.

if (asset_is_popup()) {
  [...]
}
else {
  $form['#action'] = '/' . $destination['destination'];
}

Since the asset module sets it's weight to 1 in the system table on installation, it will overwrite any customizations made to $form['#action'] on exposed view forms by other modules implementing hook_form_FORM_ID_alter() but with a smaller weight (i.e. every module not explicitly given a higher weight).

Not sure what the best fix is as I'm not sure why the line setting $form['#action'] to $destination['destination'] is here for, but I don't think Asset should indiscriminately overwrite "$form['#action'] for all exposed view forms.

Can anyone provide insight or guidance as to why that code is there and what a possible fix might look like?

At the moment, in order to avoid the risk of breaking the Asset module, I've added an '#after_build' function, but my hunch is there's a way to update Asset so that a blanket over-writing of $form['#action'] isn't necessary.

Comments

Renrhaf’s picture

Hello,

I've encountered the same problem.
I had a view exposed form and this code is removing the language, so when submitting the form, I'm losing the current language search.

It seems fixed in the lastest DEV version.

IRuslan’s picture

Hi,

Renrhaf is right. There is no such code anymore within module.

IRuslan’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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