0

I have a strange issue with a drupal site and a custom form. I have a custom module that puts a form as a block...simple input field that posts a search query to a store locator.

The form keeps getting overridden and the action/url changes randomly at random times. I need a quick solution to this whilst we debug the real issue that's causing this.

I need to write an if statement that checks the drupal_goto function that goes along the lines of if drupal_goto == /store-locator then run else change the drupal_goto action to /store-locator.

Any help would be appreciated.

ShambalaG
  • 356
  • 1
  • 7
  • 21
  • Your question isn't very clear - if you need to patch drupal_goto temporarily then do so, if not, what do you need to know? – Clive Sep 18 '14 at 09:03
  • drupal_goto('store-locator', array('query' => $query)); @Clive The function above gets overridden and the url 'store-locator' changes for some unknown reason. How can I run a check to make sure that store-locator doesn't change and if it does revert it back? – ShambalaG Sep 18 '14 at 09:07
  • If this is in a form submission, use `$form_state['redirect'] = 'path';` instead. If you already have a `destination` parameter in the URL, that will take precedence over everything. If that's happening, see http://drupal.stackexchange.com/questions/5440/form-redirect-not-working-if-destination-is-in-url-drupal-7 – Clive Sep 18 '14 at 09:11
  • Thanks @Clive - I have applied your suggestions. I will keep update this question if it works. – ShambalaG Sep 18 '14 at 16:52

0 Answers0