Problem/Motivation

InlineBlockUsageInterface::getUsage has a return type of object however it can return FALSE if there is no usage.

Proposed resolution

Update documentation.

Issue fork drupal-3278314

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acbramley created an issue. See original summary.

acbramley’s picture

Status: Active » Needs review
tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Great, thanks!

alexpott’s picture

Version: 10.0.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Fixed

I think we should file a issue to discuss changing \Drupal\Core\Database\StatementInterface::fetchObject() to state it only returns FALSE to match the behaviour of \PDOStatement::fetchObject(). But this is an improvement and FALSE is the value this returns when there's no usage, even for DBs using \Drupal\Core\Database\StatementPrefetch::fetchObject().

As a docs fix backported to 9.3.x

Committed and pushed cf7dac1848 to 10.0.x and a3562c9e38 to 9.5.x and d24d944fd5 to 9.4.x and 6ffe8b73c8 to 9.3.x. Thanks!

  • alexpott committed cf7dac1 on 10.0.x
    Issue #3278314 by acbramley: InlineBlockUsageInterface::getUsage can...

  • alexpott committed a3562c9 on 9.5.x
    Issue #3278314 by acbramley: InlineBlockUsageInterface::getUsage can...

  • alexpott committed d24d944 on 9.4.x
    Issue #3278314 by acbramley: InlineBlockUsageInterface::getUsage can...

  • alexpott committed 6ffe8b7 on 9.3.x
    Issue #3278314 by acbramley: InlineBlockUsageInterface::getUsage can...

alexpott credited dpi.

alexpott’s picture

Creditting @dpi for merge request review.

Status: Fixed » Closed (fixed)

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