Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
block_content.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Apr 2019 at 19:53 UTC
Updated:
14 Jul 2025 at 03:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
claudiu.cristeaThis patch decreases the locally test run from 9.0 to 1.8 seconds.
Comment #3
martin107 commentedTo my mind this looks like a good cleanup .. and makes things consistent.
Side note: after a visual scan of the patch
a) No extraneous changes.
b) All changes are implemented correctly.
Comment #4
larowlanthis is a base class so removing these is an api change, could we just translate them to use the trait logic and retain the signature, we'd have to use the trait methods with a different name of course
same here
Comment #5
klausiTalked to alexpott and he agrees with larowlan to keep the base class backwards compatible. As I understand it:
* The new trait has different names for the methods. I suggest insertBlockContent() and insertBlockContentType(). Is that good?
* The base class imports the trait
* The base class keeps the old method implementation and its signature. The implementation simply forwards to the trait methods.
* Add a @deprecated + trigger_error() to the old methods on the base class saying the new method names
* Update all core code to use the new method names.
* Add a test case to the legacy tests that check that the trigger_error() works.
Quite a bit of work and I think we are going a bit too far with our backwards compatibility promise here. This is just a random test base class in a random module, I would be fine with the API break.
Why are we using ->preview() here and not ->execute() as in the old test? Please add a comment.
Comment #14
quietone commentedConverting FieldTypeTest was completed in 3414259. The remaining part here is to create a trait for the creation of blocks.
I am changing the title for that new goal and removing the parent.
Comment #15
quietone commentedComment #18
acbramley commentedStarted this from scratch as much of the patch no longer applied. I've updated other tests that call something similar to createBlockContent with the trait where possible with aliases.
I've also added another optional
$valuesparameter tocreateBlockContentto support tests which were passing these to their own functions, we can then deprecate the $title and $bundle params at a later date if required.Comment #19
smustgrave commentedThis seems like a good refactor and have no objection to it as another sub-maintainer hat. Not sure if it needs a CR as a new test trait but we'll see!
Comment #22
larowlanCredits
Comment #24
larowlanCommitted to 11.x and published the change record.
Thanks all