Hi, great module - have had fun implementing this.

However.. I have a situation where I want to use the 'filter by date' form (quant_time_form()) on a custom page, but the submit handler runs a drupal_goto('analytics'). This is fairly bad practice, as it prevents other modules from overriding the submit handler! I also don't want my page to sit on /analytics, so this also needed changing for me.

Suggest something like the attached patch? Replaces:

drupal_goto('analytics', array('query' => array()));

with

$form_state['redirect'] = array(current_path(), array('query' => array()));

The end result is the same when the form is executed through drupal_redirect_form(), but the redirect URL is alterable by other custom submit handlers prior to this.

Thanks!

Also, as a slightly related note, forcing the URL to be reloaded breaks any hope of AJAXifying this form. Is there a way the form might be rewritten to include the Quant executions? I'm sure I can't be the only one that wants to run an AJAX submit handler...

CommentFileSizeAuthor
quant-patch-for-current-path.patch838 byteskpa

Comments

mstef’s picture

Good catch.. that a bad mistake on my part - not sure what I was thinking when I did that.. I'm also not entirely sure why the choice to handle the data with GET arguments was made.. there must have been a good reason.

Thanks for the patch. I'll test and commit.

I'm open to a patch to AJAXify this form, if you're interested.

mstef’s picture

Status: Active » Fixed

Committed - thanks again.

Status: Fixed » Closed (fixed)

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