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

(Remaining) Tasks

  • Patch to fix Drupal, and patch review.
  • Fix Drupal handbook pages.

User interface changes

None.

API changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mradcliffe’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: +Documentation
FileSize
709 bytes

Here'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.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

+1

jhodgdon’s picture

Looks good to me too, thanks!

mradcliffe’s picture

I modified the Create a custom block hand book page. I think that is an appropriate use of AccessResultInterface.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 093d931 and pushed to 8.0.x. Thanks!

  • alexpott committed 093d931 on 8.0.x
    Issue #2398595 by mradcliffe: Fix documentation for BlockPluginInterface...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.