I am getting the following error,
After entering code in Global php when we save i am getting Ajax error, clciking ok will save but the view breaks
Fatal error: Call to undefined function drupal_query_string_encode() in E:\wamp\www\sites\all\modules\views_autorefresh\views_autorefresh.module on line 20

Comments

jesss’s picture

I'm getting this error as well. It looks like there was a change in the function name between 6 and 7. In 7, drupal_query_string_encode() became drupal_http_build_query().

I'm not sure how to proceed -- maybe someone with better PHP skills than mine can make a patch?

jesss’s picture

I don't have access to git to make a patch, but this is what worked for me to get rid of the error message.

Starting at line 20, replace this:

  $query_string = drupal_query_string_encode($_REQUEST, array_merge(array('q', 'pass'), array_keys($_COOKIE)));
  $query[] = $query_string;
  $link = l('', $_GET['q'], array('query' => count($query) ? implode('&', $query) : NULL));

with this:

  $query_string = drupal_http_build_query(drupal_get_query_parameters($_REQUEST, array_merge(array('q', 'pass'), array_keys($_COOKIE))));
  $query[] = $query_string;
  $link = l('', $_GET['q'], array('query' => count($query) ? $query : NULL));
kaizerking’s picture

Thank you jesss!!!
I have been waiting for this

jaarong’s picture

This worked for me as well, thanks.

joachim’s picture

Status: Active » Fixed

- #1478630 by jesss: Fixed use of obsolete function drupal_query_string_encode().

Committed the above fix. Thanks!

(PS: sites\all\modules\views_autorefresh\views_autorefresh.module -- you're putting a submodule outside of its package folder!?!!!)

Status: Fixed » Closed (fixed)

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