I've patched the module. It works on our site. Please check the code to tell us if it's secure and drupal code compliant enough.

You'll see the code added between the commented lines 416 to 436 (// dev-label-080401), under the function taxonomy_quick_find_view_block($delta) { of * Function to get the contents for a block. This also includes the Javascript too. :

// dev-label-080401 : display the nodetype "name" instead of the nodetype "type"   
    $result = db_query('SELECT distinct n.nid, n.title, nt.name FROM ({node_type} nt INNER JOIN {node} n USING (type)) INNER JOIN {term_node} tn USING (nid) WHERE n.type = "%s" AND n.status = 1 AND tn.tid = %d ORDER BY n.created DESC LIMIT %d', $type, $preset, $settings['limit']);
      
      if ($result && db_num_rows($result) > 0) {
        $items = array();
        while ($node = db_fetch_object($result)) {
          $items[] = l($node->title, 'node/' . $node->nid);
         
          $nodetypename=$node->name; // new variable contains the node type name 
        }
        $output .= theme('item_list', $items, ucwords(t($nodetypename)), 'ul', array('class' => 'tqf_' . $type));
      }
      else {
      	// if the previous query has no result then we create another query 
      	$result = db_query('SELECT distinct n.nid, nt.name FROM {node_type} nt INNER JOIN {node} n USING (type)  WHERE n.type = "%s" AND n.status = 1 ORDER BY n.created DESC LIMIT %d', $type, $preset, $settings['limit']);
      	
       db_num_rows($result);
       $node = db_fetch_object($result);
       $nodetypename=$node->name;
      
      // dev-label-080401 : display the nodetype "name" instead of the nodetype "type"   

        $output .= theme('item_list', array(t('Aucun résultat associé.')), ucwords(t($nodetypename)), 'ul', array('class' => 'tqf_' . $type));
      }
    }
    return $output;
  }
  else {
    return '';
  }
}

Thank you

CommentFileSizeAuthor
#5 taxonomy_quick_find.module.txt16.92 KBdoc2@drupalfr.org

Comments

ali27’s picture

Assigned: Unassigned » ali27

Just assigning the patch

nicholasthompson’s picture

There is a function in Drupal to handle the requesting of node type names. I will add this feature separarely using that if needed.

Thanks for the idea though...

PS: For patches you may want to read the how to create patches handbook page

nicholasthompson’s picture

Assigned: ali27 » Unassigned
Status: Needs review » Fixed

Fixed in latest Dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

doc2@drupalfr.org’s picture

Status: Needs review » Closed (fixed)
StatusFileSize
new16.92 KB

Much simpler solution to the issue, against the 5.x-1.0 version of the .module file,

a small bug to fix lies line 447:
$output .= theme('item_list', array(t('No items found.')), ucwords(t($type)), 'ul', array('class' => 'tqf_'. $type));

replace it by:
$output .= theme('item_list', array(t('No items found.')), ucwords(t($types[$type])), 'ul', array('class' => 'tqf_'. $type));

You're done!

    Explanations:

I saw that only s[$type] was missing by comparing this line to the 444th:
$output .= theme('item_list', $items, ucwords(t($types[$type])), 'ul', array('class' => 'tqf_'. $type));

It's been quite a while that I've been using it like this and it still works fine. I've attached the corrected version of the module for the lazy drupalers (still with the "ucwords()" PHP function, see below)!

doc2@drupalfr.org’s picture

Version: 5.x-1.x-dev » 5.x-1.0
Category: feature » bug
Status: Closed (fixed) » Needs review

Oups, patch status, even if it's not a proper one... sorry for that.

Status: Closed (fixed) » Needs review