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

Multiple submit buttons

I need in my form multiple submit buttons. Each submit button simple add one item to cart and all items on page is in one form. How to it this possible? Thanks.

fieldset arrays

Hi

I am trying to get a form repeat feature working with Drupal (JSTools). To make this work I need to be able to output fieldset names in an array format as follows:

name="edit[location_highlights][][description]"
name="edit[location_highlights][][distance]"

location_highlights is a fieldset form class.
description and distance are input fields.

Is there any way to do this through the forms api? I have been through the api reference, google and drupal.org but cannot find any reference to this requirement!

Bug with Adsense tags

When I use the Adsense tags in my story content pages and view the page as anonymous, the placeholder ad as if I was still logged in as the admin. The Adsense block I have created works fine and can be seen correctly.

Is there some bug in 4.6 ? I get the following in the page source

Q: Insert and Update taxonomy data from my module?

Does anybody know how I would go about updating and inserting new taxonomy data from my node module? Are there any type of functions I can use from the taxonomy module or is it best to just query the database from scratch?

Thanks!

unable to set active database

hi

I have two different databases. I am trying to write my first module and got in the problem of switching between databases. I tried db_set_active but that's not helping much. Here is my scenario. I have two databases (say drupal and B). In my module I switch to Database B using db_set_active('B') and use Qcodo framework to build up my output. After that I try to switch back to database drupal using db_set_active('default') but I get an error message. The error message indicates that its trying to find session table in Database B , while it should be looking in the drupal database.

Below is my function where i am juggling different databases
function treemenu_builder() {
global $user;

require_once('prepend.inc');

drupal_add_js(base_path() . path_to_theme() .'/external/dtree.js');
theme_add_style(base_path() . path_to_theme() .'/external/dtree.css');

db_set_active('B');
$js = 'a = new dTree("a");a.config.useCookies=false;';
$js .='a.add(0,-1,"Articles","javascript: void(0);");';
// Add Articles
$articles = Articles::LoadAll();
for($i=0; $i $title = $articles[$i]->__get('Title');
$id = $articles[$i]->__get('ArticleId');
$js = 'a.add($id,0,"' . $title . '", "javascript: void(0);");';
}

db_set_active('default');
$output = '

';
$output .= ' ' . $js . '

';

pathauto problem

Hey. I just installed the path auto module and when I go to: pathauto settings page i get this error:

Fatal error: Cannot use string offset as an array in /home/sittingo/public_html/modules/system.module on line 745

I was wondering if anyone knows what is wrong. Thanks!

Pages

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