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

Wim Leers’s picture

Status: Active » Postponed (maintainer needs more info)

Did you apply any patches?

label_1 should never be considered a term ID and hence should never be present in Taxonomy API calls.

Wim Leers’s picture

Did you apply any patches?

label_1 should never be considered a term ID and hence should never be present in Taxonomy API calls.

acbramley’s picture

Nope, no patches were applied, just used drush to download 7.x-3.x

acbramley’s picture

Debugging into hs_taxonomy_hierarchical_select_children() somehow $parent is being set to "label_1" on save.

stefan.r’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Needs work

If this is still an issue, can we figure out how "$parent" became "label_1" in the first place?

mkinnan’s picture

I 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.

Island Usurper’s picture

Status: Needs work » Active

No 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.

Island Usurper’s picture

In 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.

stefan.r’s picture

I 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?

Gold’s picture

Status: Active » Closed (cannot reproduce)

It's been 3 years since the last comment and I'm unable to replicate this now.

Assuming it has been fixed in the interim.