enzo's blog

How to make the VBO option "Modify node taxonomy terms" works

When you put content taxonomy fields and VBO modules working together this can be frustrating with the "Modify node taxonomy terms" option.

AttachmentSize
views_bulk_operations-674864.patch1.38 KB

How to store all queries executed in MySQL in a Table

Hello folks.

If you have the task of debugging a Function, Store Procedure or a Program, maybe you need to store all executed queries to run a certain debug. You can do this by configuring your MySQL to store all queries inside a mysql table.

1. Enable log.

execute "SET GLOBAL general_log = 'ON';"
    execute "SET GLOBAL log_output = 'TABLE';"

2. Find inside your queries.

All queries now are stored in database/schema `mysql` inside table `general_log`, if you need to find a specific query, just run a query as below:

How to debug a MySQL function

Hello folks

If you are a MySQL Coder with some buggy functions and you need to debug this script inside you DB, but you don't know how do this, check the following approach.

1. Create a log Table

create table log ( id int AUTO_INCREMENT, 
                   timestamp int default 0 , 
                   name varchar(64), 
                   value varchar(255), key(id));

2. Update your function to include the debugging code

New Releases for Taxonomy Accordion Module

Hello folks

I just released a new version (6.x.1.3) for Taxonomy Accordion module to fix the bug http://drupal.org/node/989724.

Also, I released a new version 6.x.2.1 to enable the active trail path to start with the proper container accordion open, in order to maintain a consistent user navigation experience.

Enjoy it

Regards,

enzo

How to delete a specific node cache via code in Drupal 6

Hello folks.

If you for some reason need to delete via code the cache of a specific node and revision, you can use the snippet code listed below.

The cache_content table has a cid key this key is formed by [content:node_id:node_revision_id] , so imagine  you have a Node id: 500 and Node Revision Id: 1583 , then to delete the cache for this specific node and revision, you must run this sql.

How to get all records from a Display View in Drupal 6 via Code

Hello folks.

If you for some strange reason need to get how many records a view has in total without pagination, and you have the option to do this with php code, check the snipet code listed below.

<?php
$view = views_get_view('my_demo_view');
$view->get_total_rows = true;
$view->set_display('default');
$view->execute();
print "Total Records in my demo view:" . $view->total_rows;
?>

Enjoy it

enzo

Patch to disable redirect to External URLs with GlobalRedirect Module

Hello folks

A customer requested to remove an apparently security issue, caused by Global Redirect in the way it handles the request to translate node/xx to the human URL inside Drupal.

Well this treatment generates a problem with requests like this http://www.domain.com/?q=http://domain2.com, redirecting the customer to http://domain.com website.

How to send HTML email with drupal_mail function in Drupal 6

Hello folks.

If you need to send html email with drupal_mail function in your module,  here is a sample to achieve this requirement.

1. Implement the hook_mail in YOURMODULE

Bugfix for Drupal Taxonomy Accordion Module

Hello folks

I just released a new version (6.x.1.1) for Taxonomy Accordion module to fix the bug http://drupal.org/node/948952, now this module is enabled to render taxonomy term as Term Id or Term Name.

Enjoy it

Regards,

enzo

How to enable Print teaser of NodeReference in Drupal

Hello folks

If you have content types with cck fields as node reference and if you use the print module, you notice you get a link to the node reference, but a link in a print document is not useful.

So below there is a solution to overwrite the default nodereference theme function to render the nodereference fields as a teaser inside the print format.

Pages

Subscribe to RSS - enzo's blog