Download & Extend

Save term lineage when selecting a child term

Project:Better Select
Version:6.x-1.0-beta2
Component:Code
Category:feature request
Priority:normal
Assigned:Mark Theunissen
Status:needs review

Issue Summary

If a user selects a child term but doesn't tick the parent, this option will automatically save both the parent and child terms. This happens in the submit handler. There is an admin option added to turn this on and off. See patch, which includes the changes from my other two issues.

#376968: Give each better-select div a unique id
#376710: Use Drupal.behaviors in .js

Comments

#1

I haven't added the few lines to the function betterselect_taxonomy_form_term_from_checkboxes(), could the developers of this module help please? What does this function do? I can't seem to find the taxonomy_form_term.

AttachmentSize
betterselect-save_lineage-380898-1.patch 3.44 KB

#2

Woops, last patch was broken.

AttachmentSize
betterselect-save_lineage-380898-3.patch 3.61 KB

#3

Status:needs review» fixed

Fixed in -dev. I also split the settings form into Taxonomy and General settings.

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#5

Status:closed (fixed)» active

Hi Mark,

I've tested this a bit and found out it doesn't really save lineage. It only saves the parent of a selected term. Now if the parent is also a child (in case of a 3 level hierarchy) the parent's gradnparent isn't saved into the lineage.

- level 1
-- level 2
--- level 3

If you check level 3 then level 2 will be saved, but not level 1.

Is there a setting for this? Or should this be a new feature request?

Cheers,
Bart

#6

Status:active» needs review

Attached an easy fix for this using taxonomy_get_parents_all() instead of taxonomy_get_parents()...

Cheers

AttachmentSize
lineage.patch 655 bytes

#7

Version:6.x-1.0-beta1» 6.x-1.0-beta2

Sorry forgot to change to correct version.