Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The doc block for BlockPluginInterface::access() is not accurate. Creating a block plugin that implements the API as documented results in a fatal error as a boolean is not an object. Already someone has made a comment about the inaccurate API.
I searched "BlockPluginInterface", but did not find a corresponding documentation issue.
Proposed resolution
- Fix doc block for method to list correct return value.
- Fix handbook pages:
(Remaining) Tasks
- Patch to fix Drupal, and patch review.
- Fix Drupal handbook pages.
User interface changes
None.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#1 | drupal-2398595-fix-blockplugininterface-access-1.patch | 709 bytes | mradcliffe |
Comments
Comment #1
mradcliffeHere's a starter patch to fix the API doc.
AccessResult is a fairly robust API that probably requires its own issue or documentation pages. I haven't been able to find a page for it yet in the handbook. It may be a good idea to link to that page from the API, but it does not exist yet.
Comment #2
dawehner+1
Comment #3
jhodgdonLooks good to me too, thanks!
Comment #4
mradcliffeI modified the Create a custom block hand book page. I think that is an appropriate use of AccessResultInterface.
Comment #5
alexpottCommitted 093d931 and pushed to 8.0.x. Thanks!