Taxonomy Switch doesn't support Drupal v6.x

uranik - February 15, 2008 - 13:53
Project:Taxonomy Switch
Version:HEAD
Component:Code
Category:support request
Priority:critical
Assigned:Unassigned
Status:active
Description

taxonomy switch not support drupal v6.x :(

#1

joel_guesclin - June 27, 2008 - 11:55

It will almost certainly support D6 when D6 settles down and I start thinking about converting my own sites! Unless something better comes up in the meantime.

#2

luisfeng - August 4, 2008 - 22:40

Taxonomy Switch is very cool module, and very useful, waiting for the 6 version!

#3

that0n3guy - September 8, 2008 - 19:25

I have a site that uses this module. It is one of the last modules (I use 37 modules) on my site to do an update. Most modules have a beta version by now.

Any time frame on this?

#4

joel_guesclin - September 10, 2008 - 13:01

At the moment I am so overloaded that I will probably start thinking about this around January 2009. Sorry it is so long - if you want to try doing it yourself I would be glad to test a patch though.

#5

momper - October 22, 2008 - 09:30

subscribing

#6

Brigadier - December 21, 2008 - 02:47

subscribing

#7

Brigadier - December 21, 2008 - 03:42

Not sure if this helps but I gave the latest release for D5 a quick run through Deadwood, made a minor tweak or two and made a patch. It gives me an error on $vid_from after selecting the vocabularies but it's possible there's an issue on my development site too. Anyway, hope this helps.

AttachmentSize
deadwoodtod6.patch 9.59 KB

#8

Brigadier - December 21, 2008 - 04:35

Okay, I couldn't leave it alone. Besides the changes Deadwood made in the previous patch, I also had to change calls like

module_invoke('taxonomy', 'get_vocabulary', ... );

to
module_invoke('taxonomy', 'vocabulary_load', ...);

Apparently the name of the taxonomy module hook changed in Drupal 6. I don't know if any other module_invoke() calls need to change, but I made the module work for my site with the changes in the attached patch. Again, this patch is against the current Drupal 5 release version of the .module file (the .info file just needs a minor change to say it works with Drupal 6).

I've also attached the .info and .module file for people who want to try it out but don't know how to apply a patch but want to help test. (Don't use these on any data you care about.)

Oh, and there are some TODO comments in there that Deadwood made. I left them in because I don't know the correct way to fix them yet.

AttachmentSize
d6wfm1.patch 10.71 KB
taxonomy_switch.info_.txt 430 bytes
taxonomy_switch.module.txt 17.87 KB

#9

Kripsy - January 8, 2009 - 09:34

I've tested the patch and so far everything works fine.

#10

momper - January 8, 2009 - 10:21

i tested with some taxonomies - no problems so far ...

#11

caillou - January 8, 2009 - 10:53

subscribing

#12

mean0dspt - January 13, 2009 - 23:09

thanks, this patch worked

#13

joel_guesclin - January 14, 2009 - 13:44

Thanks very much for this - I will try it out and put up an official version as soon as possible

#14

jordanka - January 23, 2009 - 13:55

can you pls explain how to test it? I have Drupal 6 site, and I need this module asap.

#15

mean0dspt - January 23, 2009 - 16:36

-Download files from comment #8
-rename the two of them, removing .txt part from the end of the file (thus changing file extension to .module and .info)
-create new directory named "taxonomy_switch" at sites/all/modules and upload files there
-enable module in a usual way
-start using through new tab in admin -> taxonomy

#16

jordanka - January 25, 2009 - 16:28

it works perfectly on my Drupal 6.9

Thanks.

#17

rkdesantos - February 25, 2009 - 00:23
Version:5.x-1.x-dev» HEAD

I don't get the "classify" tab on v6.9.

#18

luisfeng - February 26, 2009 - 02:10

I don't get it either....

#19

kiamlaluno - February 26, 2009 - 02:19
Title:taxonomy switch not support drupal v6.x :(» Taxonomy Switch doesn't support Drupal v6.x

#20

asb - April 16, 2009 - 09:03

subscribing

Greetings, -asb

#21

joel_guesclin - April 16, 2009 - 11:15

Does your user have "administer taxonomy" permission? If not you will not see the tab

#22

rkdesantos - April 16, 2009 - 19:18

I don't get the tab even running as user 1. I verified that the admin users have "administer taxonomy" permission and still no "classify" tab.

#23

newswatch - June 5, 2009 - 12:14

I don't get it on D6.12 either.

#24

newswatch - June 5, 2009 - 12:16

I think D6 itself has settled down quite well. The major set of modules like CCK, Views have settled down too. On the other hand, many D5 modules are no longer being worked on.

#25

macrodesign - June 23, 2009 - 14:16

please help, i need to use taxonomy switch for 6.12 how can i do that, above comments are too tech-savvy. thanks

#26

rkdesantos - June 24, 2009 - 03:44

@macrodesign: if you can't follow this discussion it is probably best that you do not attempt to use the "test" version for D6 in this thread. It is not even at the level of "beta" software at this stage and as such not safe to use unless you are sure of what you are doing and take necessary precautions (backups, etc.) Hopefully, the maintainer(s) of this module will see fit to move things along further soon and get a version out there that can be more widely tested and used.

#27

macrodesign - June 26, 2009 - 20:24

Thanks RK, i will wait for a D6 release than.

#28

peted - July 4, 2009 - 03:14

Just used files available at #8 - all good so far (ie have been able to switch terms of VocabA to VocabB)

@macrodesign

If you are okay uploading a module, and you have a test site to try it on, all that is required AFAIK is to download the files from #8 - rename those files so they don't have .txt at end, ie

taxonomy_switch.info
taxonomy_switch.module

stick in a folder (for tidiness sake) upload folder to your site and enable (and give permissions if required) - worked for me

pretty much repeating what #15 said ;-)

#29

macrodesign - July 5, 2009 - 08:17

Thanks peted, i will surely give it a try

#30

joel_guesclin - August 16, 2009 - 10:38

For all those who want a true taxonomy switch in D6, can I suggest using Taxonomy Manager? See this post about Taxonomy Manager for details. I would be interested in feedback - if it works then I will deprecate taxonomy_switch.

#31

mean0dspt - August 16, 2009 - 15:47

current stable version of Taxonomy Manager doesn't have such functionality yet. So it's way to early to deprecate Taxonomy Switch. We should at least wait for stable release. Then we should see if it'll be implemented for D5 Taxonomy Manager.

#32

rkdesantos - August 17, 2009 - 01:23

I agree with mean0dspt.

#33

DamienMcKenna - November 1, 2009 - 03:58

Could someone please explain what features are missing from Taxonomy_Manager to cover the needed features from Taxonomy_Switch? Thanks.

#34

naught101 - November 14, 2009 - 01:56

@DamienMcKenna: well, the "classify" tab is actually pretty cool. Possibly it could be made into a separate module, because it doesn't really fit in Taxonomy Manager...

The other main feature is now in taxonomy manager: #269341: Move term into other vocabulary.

#35

asb - November 14, 2009 - 09:54

Hi,

actually the "classify" tab is a lifesaver for me on several D5 sites where - for whatever reason - the taxonomy fields disappeared from the node editing forms. I would really, really miss it - not only on those D5 sites.

Maybe Taxonomy manager could bundle the "classify" tab as an optional sub-module (if there's code that can be shared)?

Greetings, -asb

#36

rkdesantos - November 15, 2009 - 04:22

I agree with asb. The classify tab is incredibly valuable.

#37

kansaj - December 2, 2009 - 11:06

ok try this I thnik is working. Do mot forget to clear the cahe.

<?php
/* $Id: taxonomy_switch.module,v 1.7 2007/09/01 11:38:51 joelguesclin Exp $ */

/**
* @file taxonomy_switch.module
* This module allows you to move a term from one vocabulary to another, or to
* reclassify a node
*/
/**
* Implementation of hook_menu: Define menu links.
*
* @note See hook_menu for a description of parameters and return values.
*/
function taxonomy_switch_menu() {
     
$items['node/%node/classify'] = array(
       
'title' => t('Classify'),
       
'type' => MENU_LOCAL_TASK,
       
'access callback' => "taxonomy_switch_check_local_tasks",
       
'access arguments' => array(1),
       
'page callback' => 'taxonomy_switch_node',
       
'page arguments' => array(1),       
        );
  return
$items;
}

function
taxonomy_switch_check_local_tasks($node) {
// we introduce a new accses rule
 
return (user_access('taxonomy_switch_view'));
}
function
taxonomy_switch_node() {
global
$user;
 
$op = $_POST['op'];
 
$edit = $_POST;
//  arg(1) is the nid
 
if ($op) {
   
$node = module_invoke('node', 'load', arg(1));
   
taxonomy_node_save($node, $edit['taxonomy']);
    if (
module_exists('checkout')) {
     
module_invoke('checkout', 'checkin', arg(1));
      }
   
watchdog('content', '%type: reclassified %title.', array('%type' => $node->type, '%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid));
   
drupal_set_message(t('The document has been reclassified'));
    print
theme('page', $output);
    return;
    }
  if (
module_exists('checkout')) {
   
$checkout_info = module_invoke('checkout', 'checkout', arg(1));
    if (
$checkout_info->uid == $user->uid) {
   
$checked_out = FALSE;
    }
    else {
   
$checked_out = TRUE;
    }
    }
  else {
   
$checked_out = FALSE;
    }
  if (!
$checked_out) {
 
$output = drupal_get_form('taxonomy_switch_classify_form');
    return
$output;
    }
   else {
    
module_invoke('checkout', 'message', $checkout_info);
     }

}

/* In Drupal 5, forms must be created in dedicated builder functions */
function taxonomy_switch_classify_form($form_values = NULL) {
 
   
$form = array();
   
$form['taxonomy']['#tree'] = TRUE;
   
$node = module_invoke('node', 'load', arg(1));
   
drupal_set_title(check_plain($node->title));
     
$node_vocabs = module_invoke('taxonomy', 'get_vocabularies', $node->type);
      foreach (
$node_vocabs as $i => $vid) {
       
$form['taxonomy'][$vid->vid] = module_invoke('taxonomy', 'form', $vid->vid);
       
$node_terms = taxonomy_node_get_terms_by_vocabulary($node, $vid->vid);
        if (
$vid->tags == 1) {
             
$typed_string = array();
          foreach(
$node_terms as $ix => $n_tid) {
       
$typed_string[] .= $n_tid->name;
        }
             
$form['taxonomy']['tags'][$vid->vid]['#title'] = $form['taxonomy'][$vid->vid]['#title'];
             
$form['taxonomy']['tags'][$vid->vid]['#description'] = $form['taxonomy'][$vid->vid]['#description'];
         
$form['taxonomy']['tags'][$vid->vid]['#default_value'] = implode(', ', $typed_string);
         
$form['taxonomy']['tags'][$vid->vid]['#type'] = 'textfield';
         
$form['taxonomy']['tags'][$vid->vid]['#maxlength'] = 120;
         
$form['taxonomy']['tags'][$vid->vid]['#size'] = 60;
         
$form['taxonomy']['tags'][$vid->vid]['#autocomplete_path'] = 'taxonomy/autocomplete/'. $vid->vid;
              unset(
$form['taxonomy'][$vid->vid]);
          }
        else {
            
$form['taxonomy'][$vid->vid]['#default_value'] = array_keys($node_terms);
             }
        if (
$vid->required) {
            
$form['taxonomy'][$vid->vid]['#required'] = TRUE;
          }
      }
   
$form[] = array(
     
'#type' => 'submit',
     
'#value' => t("Classify"),
      );
//  $form['#redirect'] = FALSE;
 
return $form;
}
?>

#38

rkdesantos - December 3, 2009 - 14:30

Is the content in #37 intended as a full replacement for the module code in #8 or as a patch to it?

#39

kansaj - December 4, 2009 - 12:42

Depends on your wish you van use it as a standalone module, or as a patch. It works in both ways.
Cheers

#40

joel_guesclin - December 7, 2009 - 13:06

I will try to find some time to test this. If it works ok for me then I will make it a standalone module to replace the present one, since the rest is handled by the Taxonomy Manager module

#41

kansaj - December 9, 2009 - 11:16

Hi in case you are goiing to try it please use the code bellow. I forgot to include the function which declares the permission :)

<?php
/* $Id: taxonomy_switch.module,v 1.7 2007/09/01 11:38:51 joelguesclin Exp $ */

/**
* @file taxonomy_switch.module
* This module allows you to move a term from one vocabulary to another, or to
* reclassify a node
*/
/**
* Implementation of hook_menu: Define menu links.
*
* @note See hook_menu for a description of parameters and return values.
*/
function taxonomy_switch_menu() {
     
$items['node/%node/classify'] = array(
       
'title' => t('Classify'),
       
'type' => MENU_LOCAL_TASK,
       
'access callback' => "taxonomy_switch_check_local_tasks",
       
'access arguments' => array(1),
       
'page callback' => 'taxonomy_switch_node',
       
'page arguments' => array(1),       
        );
  return
$items;
}


function
taxonomy_switch_perm() {

  return array(
   
'taxonomy_switch_view'
 
);   

}

function
taxonomy_switch_check_local_tasks($node) {
// we introduce a new accses rule
 
return (user_access('taxonomy_switch_view'));
}

function
taxonomy_switch_node() {
global
$user;
 
$op = $_POST['op'];
 
$edit = $_POST;
//  arg(1) is the nid
 
if ($op) {
   
$node = module_invoke('node', 'load', arg(1));
   
taxonomy_node_save($node, $edit['taxonomy']);
    if (
module_exists('checkout')) {
     
module_invoke('checkout', 'checkin', arg(1));
      }
   
watchdog('content', '%type: reclassified %title.', array('%type' => $node->type, '%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid));
   
drupal_set_message(t('The document has been reclassified'));
    print
theme('page', $output);
    return;
    }
  if (
module_exists('checkout')) {
   
$checkout_info = module_invoke('checkout', 'checkout', arg(1));
    if (
$checkout_info->uid == $user->uid) {
   
$checked_out = FALSE;
    }
    else {
   
$checked_out = TRUE;
    }
    }
  else {
   
$checked_out = FALSE;
    }
  if (!
$checked_out) {
 
$output = drupal_get_form('taxonomy_switch_classify_form');
    return
$output;
    }
   else {
    
module_invoke('checkout', 'message', $checkout_info);
     }

}

/* In Drupal 5, forms must be created in dedicated builder functions */
function taxonomy_switch_classify_form($form_values = NULL) {
 
   
$form = array();
   
$form['taxonomy']['#tree'] = TRUE;
   
$node = module_invoke('node', 'load', arg(1));
   
drupal_set_title(check_plain($node->title));
     
$node_vocabs = module_invoke('taxonomy', 'get_vocabularies', $node->type);
      foreach (
$node_vocabs as $i => $vid) {
       
$form['taxonomy'][$vid->vid] = module_invoke('taxonomy', 'form', $vid->vid);
       
$node_terms = taxonomy_node_get_terms_by_vocabulary($node, $vid->vid);
        if (
$vid->tags == 1) {
             
$typed_string = array();
          foreach(
$node_terms as $ix => $n_tid) {
       
$typed_string[] .= $n_tid->name;
        }
             
$form['taxonomy']['tags'][$vid->vid]['#title'] = $form['taxonomy'][$vid->vid]['#title'];
             
$form['taxonomy']['tags'][$vid->vid]['#description'] = $form['taxonomy'][$vid->vid]['#description'];
         
$form['taxonomy']['tags'][$vid->vid]['#default_value'] = implode(', ', $typed_string);
         
$form['taxonomy']['tags'][$vid->vid]['#type'] = 'textfield';
         
$form['taxonomy']['tags'][$vid->vid]['#maxlength'] = 120;
         
$form['taxonomy']['tags'][$vid->vid]['#size'] = 60;
         
$form['taxonomy']['tags'][$vid->vid]['#autocomplete_path'] = 'taxonomy/autocomplete/'. $vid->vid;
              unset(
$form['taxonomy'][$vid->vid]);
          }
        else {
            
$form['taxonomy'][$vid->vid]['#default_value'] = array_keys($node_terms);
             }
        if (
$vid->required) {
            
$form['taxonomy'][$vid->vid]['#required'] = TRUE;
          }
      }
   
$form[] = array(
     
'#type' => 'submit',
     
'#value' => t("Classify"),
      );
//  $form['#redirect'] = FALSE;
 
return $form;
}
?>

 
 

Drupal is a registered trademark of Dries Buytaert.