Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Could you please add support for the multigroup module? The content taxonomy options works nicely, but it needs to implement a couple of hooks so that the multigroup module knows these widgets are compatible.
Also, it's been requested by cat999 in comment #260 here: #119102: Combo field - group different fields into one
Please, see attached patch. It's against the D6 branch of the content taxonomy module.
Thanks! :)
Comment | File | Size | Author |
---|---|---|---|
#20 | content_taxonomy_multigroups-350669-20.patch | 986 bytes | markus_petrux |
#18 | content_taxonomy-350669-18.patch | 727 bytes | markus_petrux |
#16 | ct_autocomplete_error.png | 146.33 KB | yasheshb |
#9 | multigroup_with_content_taxonomy.png | 11.29 KB | ARray |
content_taxonomy.multigroup.patch | 675 bytes | markus_petrux |
Comments
Comment #1
markus_petrux CreditAttribution: markus_petrux commentedBTW, The patch I attached above also removes the closing PHP tag from the end of the script.
Comment #2
mh86 CreditAttribution: mh86 commentedI'm going to wait to commit this patch until a multigroup module is committed to CCK (or own project)
Comment #3
denislabonkink CreditAttribution: denislabonkink commentedHi,
I applied the patch content_taxonomy.multigroup.patch and it failed. It says the following:
I applied the patch against content_taxonomy-6.x-1.x-dev.tar.gz
Does some1 know what I did wrong.
thx!
Comment #4
markus_petrux CreditAttribution: markus_petrux commentedThe PHP closing tag in the affected file was already removed on CVS, so the patch here is broken by that.
All you need to do is append the following functions to the end of
content_taxonomy_options.module
Comment #5
ARray CreditAttribution: ARray commentedWhy didn't you included 'content_taxonomy_autocomplete' in array?
Comment #6
markus_petrux CreditAttribution: markus_petrux commentedhmm... I believe taxonomy autocomplete is used for freetagging, and a single widget manages several values, which is not possible within the context of a multigroup.
Please, see comment #305 for an examplanation on why:
http://drupal.org/node/119102?page=1#comment-1191555
Comment #7
ARray CreditAttribution: ARray commentedSo may be there can be added some restrictions to "autocomplete" widget. For example: it will save only first value if it is located inside of content_multigroup.
Can it be realized in that way?
Comment #8
markus_petrux CreditAttribution: markus_petrux commentedWell, I guess this would need a modification on the autocomplete widget to react acoordingly when the multiple values of the field is set to 0 (meaning just one value per widget), which is what the multigroup does to fields as it can only deal with one single value per subgroup of fields.
Otherwise, the user could still enter several terms on a freetagging field part of a multigroup, but only the first one would be stored in the database. =:-o
Comment #9
ARray CreditAttribution: ARray commentedThere is another issue: If you try to save node with content taxonomy field located in multigroup it won't be saved correctly.
But if you enter a number in content taxonomy field it will show a term in a node view page. But if you try to edit the node and save again, field value will be lost.
See attachment.
Comment #10
markus_petrux CreditAttribution: markus_petrux commentedI would like to mention that filefield already committed changes to their CVS to offer forward compatibility with the content multigroup module. Please, see #367267: Compatibility issues with Content Multigroup
Latest news on the content multigroup module can be found on comment 119102#424: Content multigroup issue.
All it's needed here is the implementation of a couple of multigroup hooks, as described in #4 above. A plus would be if the freetagging widget could work with an arbitrary number of multiple values, otherwise this widget cannot be used within the context of multigroups as described here.
Comment #11
koala098 CreditAttribution: koala098 commentedsubscribe
Comment #12
cyberswat CreditAttribution: cyberswat commentedI've tested this patch in conjunction with all the latest changes going on between multi group, cck and date. It worked as expected with none of the data loss identified in #9
Comment #13
aries CreditAttribution: aries commentedI can confirm #12, works as should.
Comment #14
yasheshb CreditAttribution: yasheshb commentedmarkus_petrux:
hi.. first off, great work on the multigroup functionality http://drupal.org/node/119102. thx to all who've contributed to it.
i've started using it after using the patch from comment 512 (http://drupal.org/node/119102?page=1#comment-1422558) and instructions from
comment 468 (http://drupal.org/node/119102?page=1#comment-1386736)
i also installed content_taxonomy 6.x-1.0-beta6 and applied the patch (basically added the 2 hooks at the end of the file content_taxonomy_options.module)
i'm assuming this works for a field of type content_taxonomy that does not use autocomplete.
however, i was playing around with a sample field like this
content type = ct1
group g1 = standard
group g2 = multigroup
field f1 as follows
Type of data to store - Content Taxonomy Fields
Form element to edit the data - Autocomplete (Freetagging)
Settings for Autocompletes
Freetagging settings: Deny any new terms
Global settings
Number of values: 1
After saving this field, i noticed that a new table "content_field_f1" is not created but instead a field "field_f1_value"is added to the table "content_type_ct1".
this would mean that this is a single valued field since it's stored at the content_type table.
Now when i try to drag the field f1 and drop it into group g1 and click on save, it gives the error message "This change is not allowed. The field f1 handles multiple values differently than the Content module. Making this change could result in the loss of data."
Is this the correct workflow for a single valued content_taxonomy field using autocomplete(freetagging) ?
thx.
yashesh
Comment #15
markus_petrux CreditAttribution: markus_petrux commentedYes, but freetagging is not supported for multigroups. Only the widgets of type 'content_taxonomy_options' and 'content_taxonomy_select' are supported.
See explanation here:
http://drupal.org/node/119102?page=1#comment-1191555
BTW, when you create a field that you wish to add to a multigroup, you can drop it directly inside the multigroup from the 'Add field' section. That way the first field is created in the correct table. Otherwise, the field is added at the content type table, and then to a separate table for the field when you drop it into the multigroup.
Comment #16
yasheshb CreditAttribution: yasheshb commentedmarkus_petrux
thx for the reply. i read comment # 305 and it mentioned
"Since the freetagging field is a multiple values field per definition" hence it cannot be supported for multigroup.
however, when you do create a cck field of type content taxnomy using the autocomplete freetagging widget
it does not create another table but instead it creates an extra column in the table of the content type.
(this is when the user chooses "Number of values" = 1 when creating the cck content taxonomy field).
would this not imply only single value field for autocomplete freetagging ?
i also tried to add more than one term to a dummy content type with field
f1 of content_taxonomy/autocomplete/num_value 1
and when i tried to add more than 1 value it gave an error message
this could then be used in a multigroup imho. maybe i'm looking at a wrong angle ?
thx.
yashesh
Comment #17
markus_petrux CreditAttribution: markus_petrux commentedI haven't checked if the freetagging widget can work with single values. If so, it would be possible to try if it works in multigroups. For this, you only need to add 'content_taxonomy_autocomplete' to the list of items returned by the implementations of multigroup related hooks above.
The number of values for fields in multigroups is managed by the multigroup module, and it generates single value fields for each subgroup of fields in the multigroup. If that is supported by the freetagging widget and works, then great, we can add this widget to the list in the hooks.
If you try, be sure to have backups of your database. You will also need to clear caches after changing the code, and then try to edit the content types and play with the fields to see what happens.
Comment #18
markus_petrux CreditAttribution: markus_petrux commented@all: I have tested the content taxonomy autocomplete widget and it worked, so this one can also be added to the list of supported widgets on the content_multigroup hooks. The only caveat is that you can only attach a single term to an item when using taxonomy fields in multigroups because CCK can only support one dimension of delta values. Each field accept multiple values, but under the context of multigroups, each value is managed from its own subgroup in the multigroup.
@mh86: The multigroup module has been committed to CVS, as part of a new experimental branch in CCK. :-D
The new branch has a development snapshot that can be downloaded from here:
http://drupal.org/node/484068
For further information, please see the latest comments here: #196421: Deleting unwanted multiple values / multiple values delta issues
I'm attaching a patch against current dev code of the content taxonomy module to implement the content_multigroup hooks that are needed in order to use these widgets on multigroups.
Comment #19
asb CreditAttribution: asb commentedthank you for this! subscribing
Comment #20
markus_petrux CreditAttribution: markus_petrux commentedHere's an updated patch against latest cvs code.
I have moved the implementation of the content_multigroup hooks to content_taxonomy.module. Previous patches added them to the content_taxonomy_options module, but later we realized the content_taxonomy_autocomplete was also compatible with multigroups, so this now may belong to content_taxonomy. Makes more sense like this, I think.
Comment #21
mh86 CreditAttribution: mh86 commentedHi!
I committed your patch from #20! Thanks for your work!
I tried to add the content_taxonomy_tree widget to the allowed widget list, but as soon as I used a content_taxonomy_tree in the multigroup widget, the group stopped working (no values saved). are there any special reasons for this?
Anyway, works fine with other widgets! Great new feature!
Comment #22
markus_petrux CreditAttribution: markus_petrux commentedThank you! :)
I do not recall exactly, but when I tried, there were issues with the way the multiple values are managed by the widget.
The multigroup tries to manage the form in several ways to avoid this kind of problems, but it has limitations.
I'm not sure it if would be easy to build the taxonomy tree element in a way that's compatible with the multigroup. This needs investigation, and I has not time to do so.
Thanks again. The other taxonomy widgets work just fine. :)
Comment #25
Junro CreditAttribution: Junro commentedHello,
Freetagging widget with multiple values is still not supported for multigroups?
Thanks
Comment #26
Magnus CreditAttribution: Magnus commentedPlease reopen issue if problem still exists.
Comment #27
mdorrell CreditAttribution: mdorrell commentedsubscribe
Comment #28
Roze-1 CreditAttribution: Roze-1 commentedSubscribing !
Comment #29
Roze-1 CreditAttribution: Roze-1 commentedI am having problem with the Content Taxonomy -> Hierarchical Select
with the error message as
"This change is not allowed. The field Test handles multiple values differently than the Content module. Making this change could result in the loss of data."
Please enlighten me with this module.
Thanks in Advance!
Comment #30
iRex CreditAttribution: iRex commentedHaving the same issue problem with Content Taxonomy -> MultiSelect