Problem/Motivation
There's not a lot of usage taxonomy_*_save|delete()
Also taxonomy_get_tree() and taxonomy_check_vocabulary_hierarchy()
Proposed resolution
Replace usage of following functions with direct entity_()
methods
taxonomy_term_(save|delete|delete_multiple)
taxonomy_vocabulary_(save|delete|delete_multiple)
API changes
taxonomy_term_delete() | entity_delete_multiple('taxonomy_term', array($tid)) |
taxonomy_term_delete_multiple() | entity_delete_multiple('taxonomy_term', array()) |
taxonomy_term_save() | $term->save() |
taxonomy_vocabulary_delete() | entity_delete_multiple('taxonomy_vocabulary', array($tid)) |
taxonomy_vocabulary_delete_multiple() | entity_delete_multiple('taxonomy_vocabulary', array()) |
taxonomy_vocabulary_save() | $vocabulary->save() |
Related Issues
taxonomy_check_vocabulary_hierarchy() #1976298: Move taxonomy_get_tree() and associated functions to Taxonomy storage, deprecate procedural wrappers.
taxonomy_get_tree() #1980966: Refactor TermStorage::loadTree() to properly work with Entity
Comment | File | Size | Author |
---|---|---|---|
#8 | 1980982-taxoop-8.patch | 30.26 KB | aspilicious |
#4 | interdiff.txt | 861 bytes | andypost |
#4 | 1980982-taxoop-4.patch | 30.27 KB | andypost |
#2 | interdiff.txt | 1.41 KB | andypost |
#2 | 1980982-taxoop-2.patch | 30.23 KB | andypost |
Comments
Comment #1
andypostI see no reason to drop hook definition from taxonomy.api.php
And I think better keep this patch in one issue
Patch splitted into parts to easy review
Comment #2
andypostA bit more clean-up
Comment #3
BerdirNeeds to use the full reference, \Drupal\Core\Entity\Entity::save()
Looks good otherwise. There's a general issue to remove them from all entities but I agree that it's better to do it in steps and per entity type. The main one that's questionable at the moment are the load() wrappers, those are IMHO the only ones that are still useful.
Comment #4
andypostFixed. There's a lot of issues with tremendous size patches so I'd like to get this commited to not get the same as #1953410: [Meta] Remove field_create_*(), field_update_*() and field_delete_*() in favor of just using the ConfigEntity API
Comment #5
BerdirLooks like a no-brainer, RTBC. Will conflict with some other issues that are moving forms around, not sure which one is easier to re-roll.
Comment #6
dawehnerAdd just a tag. The patch looks great!
Comment #7
alexpottGreat patch... unfortunately needs a reroll..
Comment #8
aspilicious CreditAttribution: aspilicious commentedBeen a long time, lets see if this applies...
Comment #9
BerdirPassed, so back to RTBC.
As for the change notice, the new methods were already documented in e.g. http://drupal.org/node/1400186, maybe just extend that with a list of removed functions?
Comment #10
alexpottCommitted 5838ea9 and pushed to 8.x. Thanks!
Comment #11
alexpottOops... and lets update http://drupal.org/node/1400186 as @berdir suggested
Comment #12
andypostAdded the issue to http://drupal.org/node/1400186
Comment #14
xjmUntagging. Please remove the "Needs change notification" tag when the change notice task is complete.
Comment #14.0
xjmsummary