Maybe I'm doing something wrong, but I can't get the module to work (Drupal 6.14, localhost/XAMPP environment). I wrote a simple module (jscontent.module) implementing hook_js to experiment with the concept:
/*
* Implementation of hook_js.
*/
function jscontent_js() {
return array(
'foo' => array(
'callback' => 'jscontent_foo',
'includes' => array('theme', 'unicode'),
'dependencies' => array('locale', 'filter', 'user'),
),
);
}
function jscontent_foo() {
return "foo";
}
I enabled both modules (js and jscontent), copied js.php to the root folder and edited .htaccess as described in README.TXT. Clean url's is enabled.
When I visit http://localhost/d6/js/jscontent/foo, I get Drupal's default 'page ont found' page.
When I visit http://localhost/d6/js.php?q=js/jscontent/foo, I get:
Warning: set_error_handler() expects the argument (error_handler) to be a valid callback in G:\www\d6\js.php on line 95
Fatal error: Cannot redeclare filter_xss_bad_protocol() (previously declared in G:\www\d6\js.php:131) in G:\www\d6\modules\filter\filter.module on line 1212
When I visit http://localhost/d6/js.php, I get only the fatal error above, not the warning.
Any clues? Thanks in advance.
Comments
Comment #1
jtsnow commentedIf in a subdirectory, 'd6', you rewrite rule should be:
RewriteCond %{REQUEST_URI} ^\/d6\/js\/.*To get rid of the fatal error, remove the filter module dependency:
'dependencies' => array('locale', 'user'),Comment #2
marcvangendThanks jtsnow, I'll keep that in mind.
Comment #4
carvalhar commentedcomment #1 should be added to the readme.txt