Porting TSS to Drupal 6

Eikaa - October 27, 2008 - 12:51
Project:Taxonomy Super Select
Version:6.x-1.0
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I worked on teh module to make it work in Drupal 6. And it does if you apply the attached patch.

Maybe test it on a clean install, but everything worked for me on Drupal 6.6

The module maintainer can release it as a Drupal 6 version then.

AttachmentSize
tss_drupal6.patch7.09 KB

#1

panji - November 5, 2008 - 12:33

Subscribe

#2

matt_c - December 25, 2008 - 13:13

Is there any reason this patch hasn't been released on the main page as an official Drupal 6 version?

#3

codexmas - December 25, 2008 - 16:33

Alas, I have tried three times now to navigate through the maze that is drupal CVS.

I absolutely and unconditionally hate it. I do it so infrequently that it takes at least an hour of reading to try and get back up to speed.

If someone wants to post a zip of the modified module I think I can handle that, or if you want to become a maintainer let me know.

Frustrately,
Gord.

#4

mErilainen - January 8, 2009 - 18:10

I tried to patch it in linux with a command "patch < -p0 tss_drupal6.patch" but I get error messages:

patching file taxonomy_super_select.info
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file taxonomy_super_select.info.rej
patching file taxonomy_super_select.module

#5

matt_c - January 12, 2009 - 10:38

Hi,

Has there been any progress on the D6 port?

#6

NikLP - January 12, 2009 - 14:22

Need this so bad. Going to try out the patched version and see what happens. Need D6 though!

#7

NikLP - January 12, 2009 - 14:54

You can replace the content of the .info file with the text below if the patch fails (it did for me, too).

I looked at the patch .rej file and it seemed a simple couple of fixes were all that's required, so here it is. Can't vouch for the actual module yet, still testing, but I can install it so far with this information corrected.

; $Id: taxonomy_super_select.info,v 1.1 2007/02/07 22:11:05 codexmas Exp $
name = Taxonomy Super Select
description = Changes the default taxonomy select box into checkbox or radio buttons
dependencies = taxonomy
; Information added by drupal.org packaging script on 2008-10-07
dependencies[] = taxonomy
core = 6.x
project = "taxonomy_super_select"

#8

NikLP - January 12, 2009 - 18:05

Module appears to work fine. Have tested with taxonomy of 800+ terms in hierarchical vocab. Good stuff!

Recommend this. [Edit: modification of .info patching notwithstanding]

[Edit2: fieldsets could use a little prettifying I think. Maybe just indenting the child terms that are not in a sub-fieldset. The indentation is somewhat confusing, going up and down like that]

#9

chasz - January 20, 2009 - 08:16

+1 subscribe

#10

kenorb - January 20, 2009 - 21:05

Please make some dump.

#11

NikLP - January 20, 2009 - 21:29

Dump? Are you talking to me?

#12

kenorb - January 20, 2009 - 22:59

To anybody who can zip the whole module for review;)
I don't have any working patch tool.

#13

njehlen - January 21, 2009 - 18:56

I applied this patch (and did the .info change manually) and while things seem to be working, I'm getting a "warning: Invalid argument supplied for foreach() in /public_html/modules/taxonomy/taxonomy.module on line 70." error each time I create content. Anyone else having this problem?

#14

NikLP - January 21, 2009 - 20:09

I don't have the above problem...

kenorb: Here's a *temporary* link - http://dl.getdropbox.com/u/72790/tss.tgz

#15

Katou - January 22, 2009 - 08:54

After fighting with CVS for a few hours, I have uploaded the first release for Drupal 6.

#16

kenorb - January 22, 2009 - 11:30

Thanks NikLP.
And Katou, for commiting it;)
Now it's on the front page.

#17

kenorb - January 22, 2009 - 11:30

Any reviews if this working correctly?

#18

abu3abdalla - February 2, 2009 - 12:08

warning: Invalid argument supplied for foreach() in C:\wamp\www\drupal\modules\taxonomy\taxonomy.module on line 70

Drupal 6.9

#19

eresanto - April 2, 2009 - 21:06

re:warning: Invalid argument supplied for foreach() in ...modules\taxonomy\taxonomy.module on line 70

The problem with errors when adding a content can by solved by editing the taxonomy.module and adding some validation:

if(is_array($_element))
{
foreach($_element as $value)
}

Solution from http://drupal.org/node/129915#comment-920303

After changing it should look like this:

  if(is_array($term)) {
          foreach ($term as $free_typed) {
            $typed_terms = drupal_explode_tags($free_typed);
            foreach ($typed_terms as $typed_term) {
              $links['taxonomy_preview_term_'. $typed_term] = array(
                'title' => $typed_term,
              );
            }
           }

Good luck!

#20

martysteer - May 7, 2009 - 10:15

Shouldn't modifying core modules be considered a problem rather than a solution?

#21

Summit - May 25, 2009 - 12:21

Subscribing, greetings, Martijn

#22

dboulet - June 19, 2009 - 16:50

Also getting the error from #18.

#23

dboulet - June 22, 2009 - 15:47
Title:Patch for Drupal 6 » Porting TSS to Drupal 6
Version:5.x-1.11» 6.x-1.0

Here's a potential fix for the PHP error, it uses hook_nodeapi() to remove taxonomy terms with a value of zero from $node->taxonomy. These values are coming from checkboxes left unchecked in the node form.

AttachmentSize
taxonomy_super_select-DRUPAL-6--1_preview_fix.patch 1.06 KB

#24

aasarava - July 28, 2009 - 19:34

I tested the patch and it works for me so far. Thanks! (Haven't thoroughly tested if it adversely affects anything else, but the error message is gone.)

#25

dboulet - July 29, 2009 - 16:16

Ok, looking back now, my last patch used the wrong approach—it makes much more sense to filter the terms in a form validation function.

AttachmentSize
taxonomy_super_select-DRUPAL-6--1_preview_fix2.patch 1.5 KB

#26

coastwise - August 14, 2009 - 17:55

#25 worked for me. Thanks for the effort!

Will keep an eye and post back if I see anything strange.

Aside: should this patch for the warning have its own issue?

#27

prolific_one - August 20, 2009 - 18:18

#19 worked for me! (I don't have super select)

Thanks!

#28

natuk - August 31, 2009 - 15:43

#25 worked for me as well in a D6 installation with super select. Thanks.

#29

konrad1811 - October 13, 2009 - 09:24

I've got this too.

* warning: Invalid argument supplied for foreach() in /Users/konrad/Sites/drupal/modules/taxonomy/taxonomy.module on line 70.
* warning: Invalid argument supplied for foreach() in /Users/konrad/Sites/drupal/modules/taxonomy/taxonomy.module on line 70.

I see it after adding a term from checkbox list. Before I set my vocab to be checklist using super select I was using just regular list and there was no problem.

This error/warning only in preview.

 
 

Drupal is a registered trademark of Dries Buytaert.