Problem/Motivation
#3251378: Block Plugins don't store their context mappings on submit added (most likely accidentally) a return type to this method without BC. This will break any module with a block plugin that implements that method. It's likely this will affect many sites.
Steps to reproduce
Install 11.2
Install a module such as entity_hierarchy_microsite or any other that has a block plugin that implements the method
Try to load the site
Proposed resolution
Remove return type for now.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3537720
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:
- 3537720-remove-return-type
changes, plain diff MR !12824
Comments
Comment #3
acbramley commentedComment #4
smustgrave commentedStraight forward enough.
Comment #5
mstrelan commentedFor completeness, if anyone is wondering what happens to modules that may have already updated to the new method signature. The answer is nothing, there is no harm returning void from a subclass if the parent has no return type. https://3v4l.org/B8MS6
Comment #6
smustgrave commentedOut of my own curiosity how would we go about adding this?
Comment #7
mstrelan commentedI think base classes are similar to interfaces, so see #3333824: Enable existing interfaces to add return type hints with a deprecation message for implementors
Comment #8
xjmComment #9
xjmComment #11
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 #13
xjmGood catch, thanks @acbramley and @mstrelan!
I would ask if we should have a followup to add it back, but since this is a specific implementation of a larger API, it should be handled in our meta issues to add these typehints in a major version.
Committed to both 11.x and 11.2.x (separately, since it requires an updated baseline), as a hotfix for an unintentional BC break. It's also worth mentioning in the 11.2.3 release notes that we've resolved this regression.
Crossposted with the bot. No, bot. Bad bot.
Comment #14
xjmFixing credit for me as the committer, which the bot ate.