- Issue created by @zniki.ru
- Merge request !10678Resolve #3495966: Deprecate and replace entity_test_create_bundle(), entity_test_delete_bundle() β (Closed) created by zniki.ru
- πΊπΈUnited States smustgrave
This 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.
- π·πΊRussia zniki.ru
Do 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? - πΊπΈUnited States smustgrave
Brought 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...
- πΊπΈUnited States nicxvan
It'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.
- π¨πSwitzerland berdir Switzerland
Agreed, 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.
- π·πΊRussia zniki.ru
Thanks @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. - π·πΊRussia zniki.ru
Thanks.
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()"? - π·πΊRussia zniki.ru
Replaced entity_test_delete_bundle() and added @see links to EntityTestHooks::entityBundleInfo() as @berdir suggested.
CR draft updated. MR is ready for review. - πΊπΈUnited States nicxvan
I 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.
- π·πΊRussia zniki.ru
Thanks @nicxvan, changes applied. Ready for review.
The 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.
- πΊπΈUnited States nicxvan
This one had a couple of conflicts, rebased though should be ready for review.
- π¨πSwitzerland berdir Switzerland
Rebase looks good to me, properly merged with the now existing EntityTestHelper class.
- π¬π§United Kingdom oily Greater London
#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?
- πΊπΈUnited States nicxvan
Both functions are deprecated: https://git.drupalcode.org/project/drupal/-/merge_requests/10678/diffs#1...
- π¬π§United Kingdom oily Greater London
@nicxvan Thanks. Great. I was scrolling forever through the code : )
- Issue was unassigned.
- Status changed to Fixed
about 1 month ago 12:49am 3 March 2025 Automatically closed - issue fixed for 2 weeks with no activity.