This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Weird problem with drupal_add_js

I've got a module that I'm developing that uses a javascript import.
Everything works fine except that the drupal_add_js does not work unless I specifically print drupal_get_js.

The code that I'm using looks like this:

drupal_add_js('misc/collapse.js');

This doesn't appear to work (no script output in html) unless I do the following:

print drupal_get_js();

Everything works great after that.

Any idea what might be going on?

node_load() doesn't work when not logged in?

Hi,

I am working on a module and somewhere i need to get the path corresponding to a certain nid.
So i wrote this code:

$node = node_load(array('nid' => $nid));
$url = l($title, $node->path);

Now the weird thing: this works perfectly as long as i'm logged in as admin, but when i logout, the $url variable gets me to the base path (thus can not get the path from the node anymore). So anonymous users (about all visitors of the site) can't see this link!

Help with understanding the new node access system (Drupal 5)

Hi,

I read a lot about the new node access system at Drupal 5, but I just can't understand how it works.

I've read those about 10 times and I still can't understand it:
http://api.drupal.org/api/HEAD/group/node_access
http://api.drupal.org/api/HEAD/file/developer/examples/node_access_examp...

Please refer me to some content about it, or please explain me how it works.

Email filter/permissions

I have an unusual question/concern. Some of us know about Elgg: a learning landscape, it's somewhat similar to Drupal, but has one unique feature. The Email filter. Elgg code says the following:

when does 'insert' and 'update' in hook_nodeapi() fire?

This should brain-dead easy, but I've spent the last couple of hours and have been unable to get hook_nodeapi() to work as expected with operations 'insert' and 'update'.

I'm simply trying to execute a task using hook_nodeapi() after a node insert or update occurs. The problem is the call never occurs for 'update' or 'insert'. The functions works fine for other operations like 'load' and 'form pre'. I've outputted the value of $op after submit and the string of operations does not include 'update' or 'insert'.

help w/troubleshooting a white screen of death w/a long running site

I have a drupal site that has been upgraded from Drupal 4.5 up to Drupal 4.7.4 and has been running fine until re-setting up mailhandler (which was included in CivicSpace). I have already re-installed mailhandler using the devel module.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions