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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | hs_taxonomy-numeric-datatype-2014643-2.patch | 593 bytes | proteo |
| #1 | hs_taxonomy-sql_server_compat-2014643-1.patch | 596 bytes | azinck |
Comments
Comment #1
azinck commentedComment #2
proteo commentedHi, 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!
Comment #3
andrtroe commentedComment #5
andrtroe commentedPush to dev version. Thanks guys.