Closed (fixed)
Project:
AJAXify
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Apr 2008 at 00:39 UTC
Updated:
28 May 2008 at 10:31 UTC
AJAXify doesn't work with path alias. If node/5 has alias page/about, ajaxify couldn't use the alias /ajaxify/div.node/page/about.
Calling drupal_init_path() before menu_execute_active_handler() invoked solves this.
function ajaxify_init() {
// Get current query
$q = $_GET['q'];
$path = explode('/', $q);
if (array_shift($path) == 'ajaxify') {
// Find the element requested
$el = array_shift($path);
// Correct wrong URLs
global $base_url;
$base_path = explode('/', $base_url);
// Find intersection between incoming request and base URL
$path_itersection = implode('/', array_intersect($base_path, $path));
if ($path_itersection) {
$path = str_replace($path_itersection .'/', '', implode('/', $path));
}
else {
$path = implode('/', $path);
}
// Find the handler to execute
$_GET['q'] = $path;
drupal_init_path(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< here
// The following code is exactly index.php
$return = menu_execute_active_handler();
// Menu status constants are integers; page content is a string.
if (is_int($return)) {
....
Comments
Comment #1
owahab commentedLooks like it's working fine.
Comment #2
owahab commentedComment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.