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.
| Attachment | Size |
|---|---|
| tss_drupal6.patch | 7.09 KB |

#1
Subscribe
#2
Is there any reason this patch hasn't been released on the main page as an official Drupal 6 version?
#3
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
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
Hi,
Has there been any progress on the D6 port?
#6
Need this so bad. Going to try out the patched version and see what happens. Need D6 though!
#7
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
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
+1 subscribe
#10
Please make some dump.
#11
Dump? Are you talking to me?
#12
To anybody who can zip the whole module for review;)
I don't have any working patch tool.
#13
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
I don't have the above problem...
kenorb: Here's a *temporary* link - http://dl.getdropbox.com/u/72790/tss.tgz
#15
After fighting with CVS for a few hours, I have uploaded the first release for Drupal 6.
#16
Thanks NikLP.
And Katou, for commiting it;)
Now it's on the front page.
#17
Any reviews if this working correctly?
#18
warning: Invalid argument supplied for foreach() in C:\wamp\www\drupal\modules\taxonomy\taxonomy.module on line 70
Drupal 6.9
#19
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
Shouldn't modifying core modules be considered a problem rather than a solution?
#21
Subscribing, greetings, Martijn
#22
Also getting the error from #18.
#23
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.#24
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
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.
#26
#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
#19 worked for me! (I don't have super select)
Thanks!
#28
#25 worked for me as well in a D6 installation with super select. Thanks.
#29
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.