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.
There's only 2 usages of the function
TermFormController and TermDelete (confirm form after #1946456: Convert taxonomy_term_confirm_delete() and taxonomy_vocabulary_confirm_delete() to the new form interface)
So better move the function to TermStorageController
Comment | File | Size | Author |
---|---|---|---|
#13 | 1988712-13.patch | 6.44 KB | jibran |
#10 | 1988712-tax-hierarchy-10.patch | 5.92 KB | h3rj4n |
#3 | interdiff.txt | 822 bytes | andypost |
#3 | 1988712-tax-hierarchy-3.patch | 6.38 KB | andypost |
#1 | 1988712-tax-hierarchy-1.patch | 6.37 KB | andypost |
Comments
Comment #1
andypostAnd here's a patch
Comment #2
jibransorry for pointing that
array
missing.Comment #3
andypostfixed, nice catch
Comment #4
jibranIt is RTBC IMO but lets see what other thinks about it.
Comment #5
jibranI think it is good to go.
Comment #6
alexpottAre we sure about moving this to the storageController to me
checkHierarchy
should be a method on the vocabulary entity and also it should be calledcheckAndFixHierarchy
as that is what it does.Comment #7
andypostSo proposed was implementation of invalidateHierarchy() methid in term interface and class because of #1893772-30: Move entity-type specific storage logic into entity classes
Comment #8
jibran#3: 1988712-tax-hierarchy-3.patch queued for re-testing.
Comment #10
h3rj4n CreditAttribution: h3rj4n commentedI haven't done a reroll. Just copied an paste the code in the right place.
The function is now in the entity as suggested by alexpott. I also used the function name as alexpott said. All the taxonomy tests success locally. Let's see what the testbot says.
Comment #11
andypost10: 1988712-tax-hierarchy-10.patch queued for re-testing.
Comment #13
jibranRTBC?
Comment #15
andypostwould be nice to move that to storage controller as well, this breaks unit-testing of the entity
Suppose needs separate issue to move to vocabulary interface
Comment #16
andypostI still not sure that entity class is a right place for the function,
better to place it in storage controller
taxonomy_get_tree() should be replaced with proper injection of term storage controller
Comment #17
jibranI don't think we can move it around anymore at this point of release. This is an API break so we have to wait for D9.
Comment #18
andypostI disagree, we can deprecate it in favour of proper method that would api clean-up
Comment #19
jibranOk then let's finalize the location of the function
entity class
orstorage controller
Comment #27
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedWe're planing to deprecate
taxonomy_check_vocabulary_hierarchy()
in #2957381: Data model problems with Vocabulary hierarchy, so we won't need to move it anywhere :)