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

Problem with locale module and submit buttons...

Hey all

I've been trying to fix a problem with my module for a few days now and I'm just not getting anywhere... Thought I'd ask for some help :o)

Here's some example code:

<?php
/**
* Edits table header.
*/
function tablemanager_tableedit($edit) {
if (!is_numeric($edit)) {
drupal_access_denied();
}
$fetch = db_fetch_object(db_query('SELECT tm.name, tm.header, tm.description, tmd.data
FROM {tablemanager} tm
LEFT JOIN {tablemanager_data} tmd ON tm.tid = tmd.tid
WHERE tm.tid = %d',
$edit));
if (!$fetch) {
drupal_not_found();
}
if (!user_access('administer tables')) {
drupal_access_denied();
}
switch ($_POST['op']) {
default:
$col = substr($_POST['op'], 16);
$form['row'] = array(
'#type' => 'hidden',
'#value' => check_plain($edit),
);
$form['col'] = array(
'#type' => 'hidden',
'#value' => $col,
);
$header = unserialize($fetch->header);
if (count($header) == '1') {
drupal_goto('admin/tablemanager/tabledelete/'.$edit);
return;
}
$output = confirm_form(
'tablemanager_columndelete',
$form,
t("Are you sure you want to delete column '%col'?", array('%col' => $col)),

MENU_LOCAL_TASK doesn't work with just one task. Why?

My code below (in my hook_menu() relationship_menu() )

    $items[] = array (
      'path' => 'admin/relationship/tidy',
      'title' => t('check database'), 
      'callback' => 'relationship_check_database', 
      'access' => user_access('administer predicates'), 
      'type' => MENU_LOCAL_TASK
    );
    $items[] = array (
      'path' => 'admin/relationship/tidy/flush',
      'title' => t('flush term cache'), 
      'callback' => 'relationship_flush_terms', 
      'access' => user_access('administer predicates'), 
      'type' => MENU_LOCAL_TASK
    );

Does not work. The "flush cache" link should appear as a secondary local task listed underneath the normal "check database" page.
(the callback does trigger when requested by hand)
The link just fails to appear.

When I add a second secondary local task under the tidy/ path "check database"

    $items[] = array (
      'path' => 'admin/relationship/tidy/all',
      'title' => t('list all'),
      'callback' => 'relationship_list_all',
      'access' => user_access('administer relationships'),
      'type' => MENU_LOCAL_TASK,
    );

... They BOTH show up.

Of course I have to re-save the modules page to reset the callback paths each time.

I tracked the problem down to menu.inc:
menu_secondary_local_tasks()
<?php
foreach ($local_tasks[$pid]['children'] as $mid) {

cck and contemplate: which file defines field classes?

I'm using contemplate to theme cck output

Here is the code from the template box (of contemplate) for me to modify

BEGIN CODE
div class="field-items"

foreach ((array)$field_nameofmyfield as $item) {

div class="field-item"

print $item['view']

END CODE
(I had to modify it because it was being interpreted as formatting by drupal.org

maybe i still dont understand extending nodetype

but, what do i do wrong - other than changing core module :) - if i've added a story_load function to story_module and return few additional parameters from a joined table filtered by nid. my problem is with this method: it works well even in my other own module, but not with taxonomy. the attributes i load with story_load are missing from node object when using taxonomy/xyz.
[my module uses node_load and node_view, no hack - at least i hope so..:)

thx in advance..

/h

[i still dont get the nodeapi_example on api.drupal...]

hook_form vs. drupal_get_form

I recently updated my drupal from 4.6.3 to 4.7.2 and I found out I have to change the most part of form in my module. The most confusing part was there are several ways to generate a form. Could someone help me and clarify the following?

1. When do you want to use hook_form and when do want to generate a form using drupal_get_form function?

2. What is the mos elegant way to integrate javscript codes with your form?

Many thanks in advance.

Localization issue for "preview", "thumbnail", "original" and links

As indicated in this URL http://drupal.org/node/70396, it's impossible to translate the terms "preview", "thumbnail", "original". This problem concern the image module.

I post this message here because I use Drupal for a french site, and I would like -if possible- to have this problem solved ! ;-)

Thank you if someone can resolve this bug. ;-)

Pages

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