When activating the option "Save term lineage " in hierarchical select configuration page, drupal returns the following error:
PDOException: SQLSTATE[22018]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Conversion failed when converting the varchar 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] => 14 ) in taxonomy_get_children() (line 1087 of ..\modules\taxonomy\taxonomy.module).
As an addition to the above, by the time the module throws the following error, fails to save nodes, terms etc.
In order to fix the above issue, we go to hierarchical_select.module file and in line 986 we replace:
$hs_selection[] = $value;
with $hs_selection[] = (int)$value;
.
Clear the cache and everything works fine.
Comments
Comment #2
dnacreative CreditAttribution: dnacreative commentedComment #3
dnacreative CreditAttribution: dnacreative commentedComment #4
stefan.r CreditAttribution: stefan.r commentedI think we already had an issue for this... this fix would turn it into an int (like MySQL does) but does not fix the underlying bug
Comment #5
dnacreative CreditAttribution: dnacreative commentedYou are right, I found it out later. I am working on fixing the whole bug
Comment #6
Island Usurper CreditAttribution: Island Usurper commentedThis sounds a lot like #1648228: PDO Exception when saving a node with hierarchical taxonomy when deepest term is not selected (no dropbox). Is there another issue for this problem?
Comment #7
GoldIt is looking like #1648228 is the same issue. I suggest we postpone this until that one is sorted and retest this one.
Comment #8
GoldTriaging old issues.
I've not seen this issue in a while and the related issue in #7 is not closed as unable to replicate.
If this turns out to still be an issue please reopen with a patch and detailed steps to reproduce.