Problem/Motivation

There is 2 ways of creating an instance:

  • bare bone, with EntityInterface::create() or with EntityStorageInterface::create(). We use this only in kernel tests as far as I know
  • so through a DisplayBuildable plugin

Only the creation through a DisplayBuildable initialize a present state, the bare bone is initializing an empty array.

But this array is move around when we manipulate history and Instance::getCountPast() and Instance::getCountFuture() count this empty array.

Proposed resolution

Remove empty arrays from Instance::getCountPast() and Instance::getCountFuture(), and also prevent them to be moved around.

Fix false positives from InstanceHistoryTest

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:

Comments

pdureau created an issue. See original summary.

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Active » Needs review
pdureau’s picture

Assigned: mogtofu33 » pdureau
Status: Needs review » Needs work

I may have something to add :)

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Needs work » Needs review

  • mogtofu33 committed e8e3f12e on 1.0.x authored by pdureau
    fix: #3577023 Don't count empty steps as proper steps
    
    By: pdureau
    
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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