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.
After drupal 8.6 update the table 'taxonomy_term_hierarchy' has been moved to taxonomy_term__parent. So I have following error when access the content type with the module.
"Base table or view not found: 1146 Table 'drupal.taxonomy_term_hierarchy' doesn't exist"
The patch "2996263-6.patch" is created using tag 8.x-1.0-alpha2 for compatibility with ^1.0@alpha version.
Comments
Comment #2
gabrielolferrari CreditAttribution: gabrielolferrari commentedComment #3
gabrielolferrari CreditAttribution: gabrielolferrari commentedComment #4
gabrielolferrari CreditAttribution: gabrielolferrari commentedComment #5
gabrielolferrari CreditAttribution: gabrielolferrari at CI&T for Johnson & Johnson commentedComment #6
gabrielolferrari CreditAttribution: gabrielolferrari at CI&T for Johnson & Johnson commentedAdd fix version to tag 8.x-1.0-alpha2
Comment #7
gabrielolferrari CreditAttribution: gabrielolferrari at CI&T for Johnson & Johnson commentedComment #8
perpignan CreditAttribution: perpignan commentedSame issue on line 407 of term_reference_tree.module :
i've change the query by :
Comment #9
mark_fullmerHere's a patch that catches all of the instances needing updating, based on 8.x-1.x-dev.
Comment #10
Kgaut CreditAttribution: Kgaut commentedI can confirm that the patch in #9 fix the error ! Thanks a lot.
Comment #11
jedihe CreditAttribution: jedihe as a volunteer commentedPatch #9 also works for me. The node edit form for a node type using the term reference tree widget was not loading after I updated core to 8.6.1; just applied the patch, and it's back to working.
Thanks @gabrielolferrari, @perpignan and @mark_fullmer!
Comment #12
VladimirAusThanks for your work @gabrielolferrari, @perpignan and @mark_fullmer!
Adding some linting, refactoring and requirements.
Comment #13
RedEight CreditAttribution: RedEight at 95Visual commentedI can confirm that #12 fixed my issue. Thanks everyone.
Comment #14
igonzalez CreditAttribution: igonzalez commented#12 works for me
Comment #15
kyuubi CreditAttribution: kyuubi as a volunteer commentedWorks like a charm!
Let's get this committed please?
Comment #16
VladimirAusHappy to become co maintainer.
Comment #17
OllibolliHi guys, great to see this fixed. But i think you missed a line at the '_term_reference_tree_get_parent' function.
Over here this made it work again:
Sorry for not submitting a patch file to this instead of posting code lines. This only applies to Drupal >= 8.6.0.
All the best
Comment #18
eyilmazAdding the addition by Ollibolli.
Comment #19
rik_deuzeman CreditAttribution: rik_deuzeman commented#18 isn't working.
$query = "SELECT h.parent_target_id FROM {taxonomy_term__parent} p WHERE p.entity_id = :tid";
should be
$query = "SELECT p.parent_target_id FROM {taxonomy_term__parent} p WHERE p.entity_id = :tid";
Comment #20
eyilmazHi @rik_deuzeman.
Thanks for review, you are right, there is a critical typo :).
Here is the updated patch.
Comment #21
superlolo95 CreditAttribution: superlolo95 commented+1 for the patch with drupal 6.2
Comment #22
abellata CreditAttribution: abellata commented#20 isnt working for my 8.6.2 drupal (your git diff lines aren't matching mine)
EDIT: THE PATCH WORRKING but i couldnt use git apply to apply it.
Comment #23
dqdsimplytest.me with patch linked me to > Drupal 8.6.2 with patch applied via Dreditor. (Mayby patch needs reroll against Drupal core 8.6.3)
RTBC from me so far without closer code review or nitpicks ...
SIDE NOTE: I kind of feel that this module uses wrong and very heavy sql querying which should be changed ...
Comment #24
kimberleycgmPatch in #20 is working well for me
Comment #25
knyshuk.vova CreditAttribution: knyshuk.vova at Internetdevels, Drupal Ukraine Community commentedThe patch #20 looks good and applies successfully. +1 for RTBC.
Comment #26
mfrosch CreditAttribution: mfrosch as a volunteer commented#20 also works for me - please commit.
Comment #27
saurabh29p CreditAttribution: saurabh29p commented#20 partially applied.
In term_reference_tree.info.yml,
core: 8.x should be # core: 8.x
Comment #28
pifagorLook good
Comment #30
alex_optimComment #31
alex_optimComment #33
aadeshvermaster@gmail.com CreditAttribution: aadeshvermaster@gmail.com commentedPatch #20 is working for me for Drupal core - 8.7.3 & Taxonomy Term Reference Tree Widget - 8.x-1.0-alpha2
Comment #34
harshadananjaya CreditAttribution: harshadananjaya commentedpatch #20 is working for me.
Comment #35
krug CreditAttribution: krug as a volunteer commentedPatch #20 solved the error after migration drupal 7.54 to 8.7.6
Drupal core - 8.7.6 (nginx/1.6.2 PHP 7.2.2 MySQL 5.5.54) & Term Reference Tree - 8.x-1.0-alpha2
Error:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DBname.prefix_taxonomy_term_hierarchy' doesn't exist: SELECT h.parent FROM {taxonomy_term_hierarchy} h WHERE h.tid = :tid LIMIT 0, 1; Array ( [:tid] => 1303 ) in _term_reference_tree_get_parent() (line 408 of /var/www/clients/client22/web147/web/modules/term_reference_tree/term_reference_tree.module).
Comment #36
texas-bronius CreditAttribution: texas-bronius at Ocelot commentedHeads up, patchers - See module maintainer's message in #31: This patch has been RBTC and committed to the dev release. Confirmed working with latest
8.x-1.x-dev
release for 3 months.Comment #37
tetem CreditAttribution: tetem commented+1 for the Patch #20. It solved the error after migration drupal 8.5.15 to 8.7.8.
Thanks.
Comment #38
laura.gates+1 for the patch #20 it solved some DB issues going from 8.7.9 to 8.8.0 rc1