I have created a custom module. The Page callback got called twice. It invokes web service once in the front end and in back process its invoking one more request. Its affecting the performance of the application. Please let me know how to prevent the second request.

For this module. You can find its writing "TESTING" in to the sample text file 'wstimecalc' twice. But actually it should write only once.

Kindly provide a solution. I am using drupal 6.3

In this module, inside the test file
<?php
function test_menu() {
$items = array();

$items['test'] = array(
'page callback' => 'test_search',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
return $items;
}

function test_search() {
//Example web service call code goes here
file_put_contents(file_directory_path().'/wstimecalc.txt',"TESTING\n",FILE_APPEND);
return "test page content";
}

Comments

jon pugh’s picture

Status: Active » Closed (won't fix)

This project is unsupported. Don't use it!