Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
entity system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Dec 2024 at 09:42 UTC
Updated:
3 Mar 2025 at 00:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
nikolay shapovalov commentedComment #4
smustgrave commentedThis one I actually have some concern on. Clearly it's used throughout core so probably a fair assumption it could be in contrib. So this would immediately break people's tests.
Comment #5
nikolay shapovalov commentedDo you have any suggestion?
Adding deprecation message, means that we still need to have this hook in the code base.
Maybe we can add rector rule for that?
Comment #6
smustgrave commentedBrought this up in #core-development and @larowlan agreed this probably needs to be deprecated as there are lot of usages in contrib
https://git.drupalcode.org/search?group_id=2&scope=blobs&search=%22entit...
Comment #7
nicxvan commentedIt's not a hook, it's just a function, we can follow normal deprecation rules here and add the deprecation message to the function.
You can look at this MR for examples: https://git.drupalcode.org/project/drupal/-/merge_requests/10309/diffs
And this documentation https://www.drupal.org/about/core/policies/core-change-policies/how-to-d...
If you've not done it before the message has a specific structure so copying and updating is most likely the easiest way forward.
You'll also need a CR for the message so you'll want to create one before doing that so you have the link.
Let me know if you have any other questions, it's unfortunate that this one is trickier than the other conversions, but it's used a lot so this makes sense.
Deprecations are the most common way to do this, we've only been able to skip that for these conversions because they are test modules.
Technically in this case we don't have to deprecate because tests are not api and don't need deprecation, but since this used by a ton of contrib we make an exception and deprecate in order to notify contrib and custom code they need to update.
You can open an issue in https://www.drupal.org/project/rector to create a rule for this, but that will still require the deprecation.
If you don't want to do this I can take this one back on, let me know!
Comment #8
berdirAgreed, entity_test is a widely used test module as it is enabled by default with \Drupal\KernelTests\Core\Entity\EntityKernelTestBase, so IMHO that basically makes it an API for tests, which is also covered by BC.
Comment #9
nikolay shapovalov commentedThanks @smustgrave for your effort. Thanks @berdir for the feedback.
Thanks @nicxvan for explanation, I create CR #3497049, but not sure about version 11.1.x or 11.2.x.
Comment #10
smustgrave commentedWould be deprecated in 11.2 removed in 12
Comment #11
smustgrave commentedSince 11.1 is already out
Comment #12
nikolay shapovalov commentedThanks.
I return back entity_test_create_bundle() to entity_test.module.
Add deprecation message.
Revert change to .phpstand-baseline.php.
And rebased branch on recent 11.x.
MR is ready for review.
It looks like issue title needs to be update:
What about: "Deprecated and replace entity_test_create_bundle()"?
Comment #13
smustgrave commentedThat’s a fine title.
Comment #14
nikolay shapovalov commentedUpdate issue title.
Comment #15
nikolay shapovalov commentedComment #16
nikolay shapovalov commentedUpdate title and IS.
Comment #17
nikolay shapovalov commented@berdir thanks for feedback, set to NW.
Comment #18
nikolay shapovalov commentedComment #19
nikolay shapovalov commentedReplaced entity_test_delete_bundle() and added @see links to EntityTestHooks::entityBundleInfo() as @berdir suggested.
CR draft updated. MR is ready for review.
Comment #20
nicxvan commentedI went through everything, looks great two suggestions that need to be applied.
CR looks great short and to the point.
I can rtbc once the suggestions are applied.
Comment #21
nikolay shapovalov commentedThanks @nicxvan, changes applied. Ready for review.
Comment #22
berdirLooks good to me now.
Comment #23
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #24
nicxvan commentedThis one had a couple of conflicts, rebased though should be ready for review.
Comment #25
berdirRebase looks good to me, properly merged with the now existing EntityTestHelper class.
Comment #26
nikolay shapovalov commentedLGTM. +1 for RTBC.
Comment #27
ironnuts commented#7 mentions deprecation messages. Reading the comments I am not sure if it was decided they would not be required? I do not see any such messages in the MR: see 'Proposed resolution' in the issue summary.
Comment #28
nicxvan commentedBoth functions are deprecated: https://git.drupalcode.org/project/drupal/-/merge_requests/10678/diffs#1...
Comment #29
ironnuts commented@nicxvan Thanks. Great. I was scrolling forever through the code : )
Comment #30
nikolay shapovalov commentedUpdate IS.
Comment #32
catchCommitted/pushed to 11.x, thanks!
Comment #34
nicxvan commented