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

how to check for empty table

In Drupal 5 we have a table_exists() function to find out if a particular table exists. But how can I probe a table being empty? I dont need the actual content, just want to know wether there is data in it or not. At the moment I'm using $empty = !db_num_rows(db_query("SELECT id FROM {mytable}"));to get the total number of rows ('id' is the smallest integer field in 'mytable'). But I bet there is a faster alternative. This query is the slowest on my system (even slower than some multi-join queries). I think thats because 'mytable' is a very large one.

Views locking up modules screen

I am trying to run views.module, actions.module, and workflow.module. When I have just views in the modules folder, everything works. When I have actions and workflow in there, without views, everything works fine. However, when I have all three in there, I can't get into the modules screen.

I had a problem with actions.module when I first installed it, where I was unable to get into it's screen, but I stepped back one version on the actions.module, and that part works fine now. However, I cannot seem to find an older version of the views module.

CAS gateway authentication

We've been playing with the CAS authentication module, which seems to do everything we want with one exception. When users are not authenticated, they are directed to the CAS authentication page. There is no way to visit the site anonymously. CAS seems to support a gateway function as described in:

http://www.ja-sig.org/products/cas/client/gateway/index.html

Monitor: noSuchName Error

Hello,

I installed the monitormodule. Now I' m trying to monitor localhost. But I get this error all the time:

warning: snmpget() [function.snmpget]: Error in packet: (noSuchName) There is no such variable name in this MIB. in C:\wamp\www\hfcmonitor\includes\common.inc(1180) : eval()'d code on line 2.

Even when I just try php-code like this:

snmpget("selene", "public", "3.0");

What am I doing wrong here?

Multi-drupal instances saving one blog/page (content) accross all

Yeah this is fun.

When a user creates content, in addition to the group list for the instance of drupal they are working on, I have a set of checkboxes with the names of other instances and groups (there is cross-instance membership) to ALSo push that content to. The problem is I am having a difficult time figuring out how node publishing works just by looking at the code.

What I want to say is

user_mail function and line breaks

Hi All,

We have a custom module which is using the user_mail() function to send an email to a user (based on input from a web form) - all pretty standard stuff.

Everything works perfectly 99% of the time, but with some clients/accounts some of the "\n"s are not displaying.

The email is built up roughly like this

$email = "some text" . $some_escaped_var . "\n some text" . $another_escaped_var . "\n";

And so on.

Interestingly when the single "\n"s are failing double "\n\n"s are appering as a single break.

Pages

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