Attempting to "add" a taxonomy term via the HS widget when the term being added has children but *none of the children are selected* results in an "Invalid response from server" when using SQL Server as your backend.

The more detailed error message is:
PDOException: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting the nvarchar value 'label_1' to data type int.: SELECT t.[tid] AS [tid] 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] => 3 ) in taxonomy_get_children() (line 1076 of C:\xxx\docroot\modules\taxonomy\taxonomy.module).

This is caused by hs_taxonomy_hierarchical_select_children() happily passing along a string as the value of the parent argument when it calls taxonomy_get_children(). Patch will be attached shortly.

Comments

azinck’s picture

Status: Active » Needs review
StatusFileSize
new596 bytes
proteo’s picture

Issue summary: View changes
Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new593 bytes

Hi, this very same problem affects other DBMs aswell, I'm having the same issue when using Postgres. I gues that's because they're not as forgiving as MySQL when dealing with type casting. Anyway, this needs to be fixed because an important feature (creating new terms) is unusable as it is (changing the priority to Major).

The patch above solves the issue, I'm just re-rolling an updated version for the latest dev branch. Please mantainers, review and commit.

Thanks @azinck for the solution, it saved my day!

andrtroe’s picture

Assigned: Unassigned » andrtroe

  • andrey.troeglazov committed 0d59df6 on 7.x-3.x
    Issue #2014643 by azinck, Proteo, andrey.troeglazov: "Invalid response...
andrtroe’s picture

Assigned: andrtroe » Unassigned
Status: Reviewed & tested by the community » Fixed

Push to dev version. Thanks guys.

Status: Fixed » Closed (fixed)

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