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.
This is a simple wrapper that unusable
Drop taxonomy_term_load_multiple() and replace all usage with entity_load_multiple()
Comment | File | Size | Author |
---|---|---|---|
#21 | get_rid_taxonomy_term_load_multiple-2010138-21.patch | 1.28 KB | shravan sonkar |
#7 | get_rid_taxonomy_term_load_multiple-2010138-7.patch | 4.08 KB | worldlinemine |
Comments
Comment #1
xxAlHixx CreditAttribution: xxAlHixx commentedWDG (Ukraine,Kharkov) want to implement this on CodeSprintUA.
Comment #2
xxAlHixx CreditAttribution: xxAlHixx commentedComment #3
andypostThis test is needed to test load by properties. Please update its doc-blocks
Please do not drop this test.
Just update here
Comment #4
andypostSo testing entity_load_multiple() and entity_load_multiple_by_properties()
Comment #5
daven CreditAttribution: daven commentedPatch no longer applies. But also I did the following grep, and the only result is the deprecated function definition.
So I believe this ticket is now obsolete.
Comment #6
worldlinemine CreditAttribution: worldlinemine commentedNote: the patches need to be modified because they include changes that were addressed as part of #2022509: Deprecate taxonomy_vocabulary_load_multiple() and taxonomy_term_load_multiple() in favour of entity_load_multiple(). The related issue addressed removing references to the wrapper function but left the wrapper function and tests intact in the taxonomy module code.
I asked myself "Should we complete removing the deprecated wrapper function (taxonomy_term_load_multiple) found here: core/modules/taxonomy/taxonomy.module [lines 682 to 684]?
I believe that yes, we should remove the function and it's related tests (LoadMultipleTest).
I'm working on the patch.
Comment #7
worldlinemine CreditAttribution: worldlinemine commentedCreated patch which removed the test file and edited taxonomy.module to remove unwanted wrapper function.
Comment #8
andypostSuppose better remove usage of
taxonomy_term_load_multiple_by_name
hereComment #9
worldlinemine CreditAttribution: worldlinemine commented@Andypost given that taxonomy_term_load_multiple_by_name() is more then a wrapper function would it make sense to separate this out into a second issue so that we can complete removing taxonomy_term_load_multiple_by_name()?
Presently the function is found in the taxonomy.module, TermLanguageTest.php, VocabularyPermissionsTest.php, and TermTest.php which tests more then just taxonomy_term_load_multiple_by_name().
In the event all usage of taxonomy_term_load_multiple_by_name() should simply be removed from the 4 files mentioned above, I'd be happy to re-create the patch.
Comment #10
andypost@worldlinemine yes, please. The same was in #2022509: Deprecate taxonomy_vocabulary_load_multiple() and taxonomy_term_load_multiple() in favour of entity_load_multiple()
After function become deprecated and usage are cleaned up then follow #2042165: Add a 'deprecated' module that includes deprecated functions only when enabled
Comment #11
ianthomas_ukI've split taxonomy_term_load_multiple_by_name() out into #2197767: Remove uses of Deprecate taxonomy_term_load_multiple_by_name() in favour of entity_load_multiple_by_properties() and restored the original title (I don't understand why it was changed from one function to another in #10).
The function is not used, #7 still applies and does what it says it does, so RTBC.
Comment #12
xjmHm, so. We recently discussed leaving in the deprecated entity CRUD BC wrappers since we don't gain much other than poking people in the eye by removing them. Let's hold off on committing this until I can get confirmation on that point, at least.
Comment #13
ianthomas_ukIf that's the case, then #2187735: Add removal information to docblock of all @deprecated functions will need to be updated to reflect that. ("will be removed before Drupal 8.0" > "may be removed in Drupal 9.0")
Comment #14
BerdirSee #2190313: Add $EntityType::load() and loadMultiple() to simplify loading entities, which would allow us to remove or at least deprecate them in favor of something that does not result in reduced DX ( correct type hints for the specific entity type, easy way to call it in procedural code)
Comment #15
ianthomas_ukI think #12 needs to be addressed before this is RTBC.
Comment #16
ianthomas_ukPostponed on #2190313: Add $EntityType::load() and loadMultiple() to simplify loading entities
Comment #17
andypostComment #18
ianthomas_ukThat patch won't apply any more.
We'll also need to update https://www.drupal.org/node/1413672 and ensure this is covered by a change record. IMO the best way to do that is to list the old and new functions on the change record for #2190313: Add $EntityType::load() and loadMultiple() to simplify loading entities.
Comment #19
parvind87 CreditAttribution: parvind87 commentedI have searched for the function - "taxonomy_term_load_multiple()" into entire core drupal 8 and didnt find any usage of this function except the function declaration. Please review.
Comment #20
ianthomas_ukFix tag. Please announce at your sprint that the right tag does not include a #.
Comment #21
shravan sonkar CreditAttribution: shravan sonkar commentedI Have removed this function in taxonomy.module
Comment #22
lakshminp CreditAttribution: lakshminp commented#21 removes taxonomy_term_load_multiple() in taxonomy.module.
Comment #23
ianthomas_ukChange records still haven't been done, see #18
Comment #24
Tebro CreditAttribution: Tebro commentedUpdated https://www.drupal.org/node/1413672
Comment #25
rpayanmComment #26
XanoThanks for working on this! At this point in the release cycle we can no longer remove functions like these, but we can replace all usages and mark them deprecated by adding
@deprecated Deprecated as of Drupal 8.0.0. Use \Drupal\taxonomy\Entity\Term::loadMultiple() instead.
to the function's docblock.Comment #27
veerasekar89 CreditAttribution: veerasekar89 commentedthere's already one
Comment #28
Xano@timplunkett informed me that this annotation is wrong and all CRUD functions like these are in fact scheduled for removal before Drupal 8.0.0 comes out.
Comment #30
andypostThis removal is a last step of efforts like #2022509: Deprecate taxonomy_vocabulary_load_multiple() and taxonomy_term_load_multiple() in favour of entity_load_multiple() and #2022509: Deprecate taxonomy_vocabulary_load_multiple() and taxonomy_term_load_multiple() in favour of entity_load_multiple()
Comment #31
alexpottWe said we would remove this in 9.x and so we should.
Comment #32
catchDuplicate of #2716163: [META] Remove deprecated classes, methods, procedural functions and code paths outside of deprecated modules on the Drupal 9 branch.