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

db_rewrite_sql and _db_rewrite_sql: can someone explain?

Hi everybody..

Can someone explain db_rewrite_sql and _db_rewrite_sql ?
What are those function used for? Why should I implement them on my modules?

A little example might be clearifing.

Thanks

Fabio

insert problem

i added new textbox in poll module . and i want to save it to poll_newtable table then i'm getting error.
can u help me how to save it .
and i'm not getting value of $node->textbox name.

user warning: Unknown column 'score' in 'field list' query: INSERT INTO vote_ram (nid, color) VALUES (18, score) in C:\xitami\webpages\sarag\includes\database.mysql.inc on line 108.
i tried all possible mothods.
thanks.

Different result in MySQL and in Drupal (query limitations??)

Hi

I get different answers if I execute a query in my code than if I do on the command line.
The query and its results from a var_dump() are:

$query = "SELECT sum(principles_rating)/count(evalstatus) as principles_r,sum(examples_rating)/count(evalstatus) as examples_r ,sum(language_rating)/count(evalstatus) as language_r ,sum(complexity_rating)/count(evalstatus) as complexity_r FROM fhsstadmin_evaluation WHERE evalstatus='1' AND pageuid = %d";
 //Perform the query
 $queryResult = db_fetch_object(db_query($query,$user->uid));
 var_dump($queryResult);

Results:

object(stdClass)(4) { ["principles_r"]=>  NULL ["examples_r"]=>  NULL ["language_r"]=>  NULL ["complexity_r"]=>  NULL }

but if I login to mysql and perform the same query (uid is 10) I get:

mysql> SELECT sum(principles_rating)/count(evalstatus) as principles_r,sum(examples_rating)/count(evalstatus) as examples_r ,sum(language_rating)/count(evalstatus) as language_r ,sum(complexity_rating)/count(evalstatus) as complexity_r FROM fhsstadmin_evaluation WHERE evalstatus='1' AND pageuid = 10;
+--------------+------------+------------+--------------+
| principles_r | examples_r | language_r | complexity_r |
+--------------+------------+------------+--------------+
| 2.50 | 1.50 | 2.00 | 1.50 |
+--------------+------------+------------+--------------+

Anyone using Zend Studio Debugger?

I'm curious if anyone is using Zend Studio to debug local installations of drupal? I've been using Zennd for development purposes for a while but just decided to try and make it work locally allowing me to debug code without actuallly running it on my server.

I managed to get the server up and running fine but can't seem to make it debug drupal. Any suggestions, tips, etc would be greatly appreciated. Please share your experiences with this product.

Tagadelic

I like this module alot. A few things that I really like to see:

1. ported to 4.7 (wasn't it designed for 4.7 primarily?)

2. combined with node_vote, for example, to express tags in "2 dimensions" (font size and color). For example, tags with a higher post count are displayed in bigger fonts; whereas tags whose average quality (as measured by the average scores of posts categorized by the tags using somethng like node_vote) are displayed with a darker color.

Then, I think this module would really be something else.

Why the change in the from API from beta2 to beta3 with regards to #type => checkboxes, and how to deal with it?

The result of a #type => checkboxes call changed. and my module is misbehaving :-(

In beta 2 the array from a group of checkboxes created with a #type => checkboxes call would look something like this:

[file] => Array
        (
            [files/uploads/jsdomenu.config.js] => 1
            [files/uploads/jsdomenu.inc.js] => 0
            [files/uploads/jsdomenu.js] => 0
            [files/uploads/jsdomenubar.js] => 0
        )

Now in beta3 it looks like this:

[file] => Array
        (
            [files/uploads/jsdomenu.config.js] => files/uploads/jsdomenu.config.js
            [files/uploads/jsdomenu.inc.js] => 0
            [files/uploads/jsdomenu.js] => 0
            [files/uploads/jsdomenubar.js] => 0
        )

I had validation code depending on that 1!! *argh*
Anyway, it should not be too much of a problem to work around that. The real problem is that when validation fails, or preview is used, all checkboxes become checked automagically. That did not happen in beta2.

this is how I call the checkboxes:

$form['files']['file'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Files'),
      '#default_value' => $node->file,
      '#options' => $files,
    );

And this is a typical $files for the #options:

Array
(
[files/uploads/jsdomenu.config.js] => jsdomenu.config.js

Pages

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