This patch gets the activeselect widget working in 5.1. It does not work with saving to the cck table, only as a tag. As well, I did not look or try the other widget types so I have no idea if they work.

Subtle changes are that the javascript (in my testing) does not like the # mark and will not return it, so I replaced it with the @. As well, the names of the fields have changed in 5.x such that all _ (underscores) get replaced with - (dashes) so the activeselect_target field and the activeselect_extras fields don't get matched properly. A str_replace fixed that up.

Numerous other changes to get the default values to work correctly and the saving of the values to tags, the biggest change being in the content_taxonomy_activeselect_field_load function which is a complete rewrite.

I am not submitting this as a completely polished patch. It is just the changes that I made to get it working on a site I am helping develop.

I have two additions in mind, one that will likely get done and another that would be nice but sometime in the future.
1) Display all levels of the activeselect box when viewing the node. Currently only one (the lowest populated) level is displayed.
2) More than three levels of activeselect

Comments

WRXIzumi’s picture

Just a note to give due credit. My work on the changes in this patch was sponsored by leftrightminds.com

svogel’s picture

Hi WRXIzumi,

thanks for this patch. I just thought I'm going to get crazy to find this. Now that I want to submit a patch, I found your patch ... ARRRRGGGHH.

I would rather have used the function form_clean_id($field['field_name']) instead of str_replace('_', '-'...) (because form_clean_id changes the id-attribute of the target and if that changes - hopefully not - content_taxonomy should generate the targets in the same way).

But nevertheless. The next time I have to search better for already made patches :-)

Best regards
Stefan

htxt’s picture

The patch fails at 126 for me

svogel’s picture

Hi
I have applied the patch manually (sorry, haven't yet gotten patch run on windows).

But as I've found out now: it doesn't work correctly with IE. On Firefox everything is fine. But in IE I got the following behaviour. I added a ActiveSelect-"Taxonomy Field" to a content type with 3 levels (and a depth of 3).
The first level (select-box) is filled, the second one has only the width of the scrollbar. Changing the first select-box doesn't fill the second select-box, though the Ajax-Request was made.
Any hints why this is different in IE?
Maybe it's due to the "@"?

Best regards
Stefan

shane birley’s picture

Patrick Nelson’s picture

Hi,

I have applied this patch but, with or without it, I just cannot get activeselect to work. I am sure that it is something I am doing (or not doing) as I can see that other people seem to be achieving varying degrees of success with this, so I would appreciate any help or pointers in the right direction.

First of all, I am running:
Drupal 5.1
activeselect.module -> v1.9
content.module (cck) -> v1.90.2.39
content_taxonomy_activeselect.module -> v1.1 (with this patch applied)
content_taxonomy.module -> v1.2.2.5 (with this patch applied)

I have a vocabulary set up as follows:

Vocabulary name: Location
Terms:
Albania
-- Berat
-- Dibër
-- Durrës
...
United Kingdom
-- Ayrshire
-- Bedfordshire
...

The vocabulary itself is set to Multiple hierarchy, Multiple select, Required.

The CCK field that I'm creating is a Taxonomy Field | ActiveSelect. In the options, I am choosing:

Label: Location
Label for second bar: Region
Default value: I'm leaving this blank
Data settings: Save as tag
Specify terms to show:
Vocabulary: Location
Terms: --
Depth of taxonomy tree: I'm leaving this blank

When I go to create a new content type (that contains this field), I see the following:

A dropdown field labelled: Location: which has the first term in it (Albania) and the revolving blue activeselect widget. I can choose anything I want in this dropdown field but nothing else happens.

I also see another dropdown field labelled: Region:. The box itself has a greyed out activeselect widget but the field has no terms populating it.

Any help would be greatly appreciated.

Regards

Patrick

GLHMarmot’s picture

Title: Patch for content_taxonomy_activeselect » Current development version works great

Thanks for applying a version of the patch. Or at least rolling back to a version that had the same effect. I can confirm that the Apr 9, 2007 development version of this module now works great with content_taxonomy under Firefox and IE 6. (I did not test with IE 7 but expect the same result.)

Woot...on with the show.

GLHMarmot’s picture

Title: Current development version works great » There is also a required patch/fix/latest version required for the underlying activeselect

There was also a bug in activeselect. As Shane pointed out above, the thread is here: http://drupal.org/node/129027

I should have mentioned this and completely forgot. The current (As of April 9, 2007) development version works and does not require the patch from the thread above.

As well please ignore the previous comment. It was supposed to be for the activeselect module, not this one.

smitty’s picture

StatusFileSize
new1.66 KB

I applied the patch and got a reject in line 126. See attached file.

Nonetheless the select-boxes work fine.
But the result is not stored, neither in cck-tables nor in the node. Is this the same issue as http://drupal.org/node/121242 and http://drupal.org/node/141225 ?

henigushi’s picture

The patch updates two "sub" modules contained within the main content_taxonomy module folder:
1) content_taxonomy_activeselect.module
2) content_taxonomy.module

Like Smitty, I got a rejection when I attempted to apply the patch. I then modified the patch by removing lines 170 to 201 so that it would only patch the content_taxonomy_activeselect.module. This resolved the problems described here as far as active selection goes.

You'll see in the description that this patch does not resolve the problem about not being able to write to both the node and the CCK table. Luckily, this has been discussed in the issue "Taxonomy association - broken". You'll find a patch there for the content_taxonomy.module that seems to do the trick.

There is one last bit that is giving me major headaches. Even though the modified patch here and the patch at the other issue node solve the "writing" problem, the values from CCK fields I assigned the activeselect widget to don't show up in my view (page) next to the CCK field title, even though the values are written to the CCK table. I would be *grateful* if someone can figure that one out.

mh86’s picture

Status: Needs work » Fixed

I finally was able to fix the problems in the content_taxonomy_activeselect.
At the moment it only supports the saving as tag in the term_node table.

Thanks for the patch and your help.
Try out the latest version from today...
If problems still exists, reopen the issue :)

Matthias

Anonymous’s picture

Status: Fixed » Closed (fixed)
jasonwhat’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Active

I added to this duplicate before seeing that this is seems more active. reopening.
http://drupal.org/node/122042

magnus’s picture

Status: Active » Closed (fixed)

Cleanup of old issues. According to maintainer: "active development is only done for the 6.x branch! 5.x is not supported any more".
Open a new issue if this still exist.