Problem/Motivation
In #3346394: Replace BlockContentController::add with EntityController::addPage via the AdminHtmlRouteProvider route provider we are moving block content to use generic entity stuff for routing, including the add page
Block content has custom code to sort its bundles by label in the current controller for the add page BlockContentController::addPage
#3196798: Fix EntityController::addPage so bundles are sorted by label and not ID will add this sorting to the generic EntityController::addPage but only for config entity types that implement EntityDescriptionInterface, plus this interface is required to add the description as well.
Steps to reproduce
N/A
Proposed resolution
Make BlockContentTypeInterface extend EntityDescriptionInterface
Remove BlockContentTypeInterface::getDescription
Implement setDescription
Remaining tasks
Do it
API changes
BlockContentTypeInterface extends EntityDescriptionInterface - I don't think this warrants a CR.
Issue fork drupal-3530654
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3530654-blockcontenttype-should-implement
changes, plain diff MR !12396
Comments
Comment #3
acbramley commentedComment #4
smustgrave commentedAssume the test-only changes should of failed?
Comment #5
ironnuts commentedWould a simple unit test provide test coverage? To mock the setDescription interface..
Comment #6
ironnuts commentedAdded skeleton unit test (needs work).
Comment #7
acbramley commentedRe #4 - no since this wasn't a bug fix. I've added test coverage for setDescription now though which would fail since setDescription didn't exist before.
@oily I'm not sure what the unit test was but I've removed it, we can just use a kernel test.
Comment #8
ironnuts commented@acbramley Okay with the test. Perhaps pedantically I thought implementing a new interface would mean a unit test. I support a kernel test if ticks the box. The unit test was incomplete. Not fluent on unit tests. Would have mocked the new interface if someone else hadnt..
Comment #9
danielvezaChanges look good, match the IS and have test coverage. I think this is ready for RTBC.
Comment #10
acbramley commentedAdding credit.
Comment #13
larowlanCommitted to 11.x, nice one