Seems not work right if drupal is installed in document root
| Project: | AJAX Views |
| Version: | 5.x-1.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | febbraro |
| Status: | active |
An "AJAX paging block view"-block only prints the progress.gif and "Loading content for ..." if drupal is installed directly in document root. Using a second virtual host, where drupal resists in folder "/drupal", it works fine.
Firefox javascript error console:
Fehler: [Exception... "'Die Erlaubnis für den Aufruf der Methode XMLHttpRequest.open wurde verweigert' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "" data: no]
Translation is like:
Error: [Exception..."Permission for method call XMLHttpRequest.open denied when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "" data: no]

#1
Not sure I understand. It only works when in the docroot? or only when in a sub folder?
I will admit that I have not tested it installed in a sub-folder, but that will be next on the list I guess.
#2
I am having the same problem just now. The error appears only with clean-urls on.
#3
It does not work if drupal is in docroot. In subfolder it works.
(with clean-urls enabled, if disabled anything is fine)
#4
Can you show me the snippet of JavaScript that is in the head section of your page that loads it remotely?
#5
Do you mean this:
<script type="text/javascript">$(document).ready(function() {$.get('//wein_nav/ajax', {page: 0}, function(data, status) {
$('.ajax-view-block-Wein-nav').html(data);
});
})</script>
#6
Getting above hint from febbraro, I found whats wrong. An patch is attached.
Please re-validate, because I am not sure if it works under any circumstances without trailing slah in _generate_ajax_url(). May this should be solved in common.php url()?
#7
#8
Damn, I knew something was funky. I have had this fixed for a long time, turns out it is in the DRUPAL-5 branch of the code and somehow never made it into the "release". Sorry about that, i am still trying to figure out the best way to use CVS/Drupal.org for module release development. Now that this is largely resolved, I will work on getting a new build out that will include this (finally) and the translatable fix that you submitted.
Thanks, sorry for the issues.
#9
Fixed in release 1.4 out on d.o now.
#10
I'm having the same problem with the ajax views module, like sebastiang.
I've tried the patch you post here and it doesn't work.
my javascript code generated with the functiont _generate_ajax_url is this one:
<script type="text/javascript">$(document).ready(function() {$.get('/mosquito//ajax', {page: 0}, function(data, status) {
$('.ajax-view-block-clubinfo-liveact-ajaxtest').html(data);
});
})</script>
and my original function code is this one:
function _generate_ajax_url($view) {$url .= "$view->url";
$i = 0;
foreach ($view->argument as $argument) {
if($argument['type'] == 'ajax_response') {
$url .= "/ajax";
}
else if ($view->args[$i]){
$url .= '/' . $view->args[$i];
}
else if ($argument['wildcard']) {
$url .= '/' . $argument['wildcard'];
}
else {
$url .= "/*";
}
$i++;
}
return url($url);
}
I don't know which is the correct url to get work ajax views module.
Also I have tried creating a virtualhost and putting the drupal into de DocRoot, or putting it in a subfolder, and any of those solutions work.
I hope someone find the solution.
thanks,