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.
I have a hierarchical taxonomy with the following configuration:
Save lineage: Save term lineage
Level choice: Allow the user to choose from any level
Resizeable: Disabled
All following checkboxes are unticked.
When I create a node using this taxonomy if I choose a term that has a child (i.e it's not the deepest term I'm choosing) I get the following error:
PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "label_1" LINE 5: WHERE (h.parent = 'label_1') AND (t.vid = '4') ^: SELECT t.tid AS tid, t.weight AS tweight, t.name AS tname FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} h ON h.tid = t.tid WHERE (h.parent = :db_condition_placeholder_0) AND (t.vid = :db_condition_placeholder_1) ORDER BY t.weight ASC, t.name ASC; Array ( [:db_condition_placeholder_0] => label_1 [:db_condition_placeholder_1] => 4 ) in taxonomy_get_children() (line 969 of /example/modules/taxonomy/taxonomy.module).
Running Core 7.14 and the latest 7.x-3.x-dev of HS
Comments
Comment #1
Wim LeersDid you apply any patches?
label_1 should never be considered a term ID and hence should never be present in Taxonomy API calls.
Comment #2
Wim LeersDid you apply any patches?
label_1 should never be considered a term ID and hence should never be present in Taxonomy API calls.
Comment #3
acbramley CreditAttribution: acbramley commentedNope, no patches were applied, just used drush to download 7.x-3.x
Comment #4
acbramley CreditAttribution: acbramley commentedDebugging into hs_taxonomy_hierarchical_select_children() somehow $parent is being set to "label_1" on save.
Comment #5
stefan.r CreditAttribution: stefan.r commentedIf this is still an issue, can we figure out how "$parent" became "label_1" in the first place?
Comment #6
mkinnan CreditAttribution: mkinnan commentedI am getting this same error on a new install of Drupal and the basic modules enabled for HS to work.
PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "label_3" LINE 5: WHERE (h.parent = 'label_3') AND (t.vid = '2') ^: SELECT t.tid AS tid, t.weight AS tweight, t.name AS tname FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} h ON h.tid = t.tid WHERE (h.parent = :db_condition_placeholder_0) AND (t.vid = :db_condition_placeholder_1) ORDER BY t.weight ASC, t.name ASC; Array ( [:db_condition_placeholder_0] => label_3 [:db_condition_placeholder_1] => 2 ) in taxonomy_get_children() (line 1087 of /var/www/html/nexturn/modules/taxonomy/taxonomy.module).
HS version is 7.x-3.0-beta2 .
The issue only seems to happen when the deepest level term is not selected. No errors when the deepest term is selected.
Comment #7
Island Usurper CreditAttribution: Island Usurper commentedNo patch, so this should be Active.
I'm in the exact same situation.False, I'm using the dropbox. Otherwise, I get the same problem.
Comment #8
Island Usurper CreditAttribution: Island Usurper commentedIn
form_hierarchical_select_process()
, when you press "Add" after only selecting the first level,$element['#value']['hierarchical_select']['selects']
contains that term and "label_1". This gets copied into$hs_selection
and$db_selection
by_hierarchical_select_process_calculate_selections()
.The question then is whether "label_1" should be copied over to
$db_selection
, or if it should appear in$element['#value']
in the first place.Comment #9
stefan.r CreditAttribution: stefan.r commentedI vaguely remember there was an issue touching on this as well a few months ago (that is still set to NR or NW), maybe check some of the latest issues?
Comment #10
GoldIt's been 3 years since the last comment and I'm unable to replicate this now.
Assuming it has been fixed in the interim.