Spin-off issue from #2811429-10: Switch to feed owner during manual import.

Problem/Motivation

When a state on the feed is explicitly set to NULL for a certain stage and then calling $feed->saveStates(), then $feed->getState() will return NULL for that stage. This is a bug because FeedInterface::getState() isn't supposed to return NULL. It should always return an instance of StateInterface.

Proposed resolution

Check the value that is being get from the Drupal key/value store for the stage and feed in question. If it returns an empty value, then create a new State object.

Remaining tasks

Implement the proposed resolution and commit it if tests are passing.

User interface changes

None.

API changes

None.

Data model changes

None.

Patch will follow.

Comments

MegaChriz created an issue. See original summary.

megachriz’s picture

Status: Active » Needs review
StatusFileSize
new862 bytes
new1.95 KB

The last submitted patch, 2: feeds-get-state-3086342-2-tests-only.patch, failed testing. View results

megachriz’s picture

Status: Needs review » Fixed

The tests only patch fails and the patch with the fix passes. Committed #2.

  • MegaChriz committed 7b2a689 on 8.x-3.x
    Issue #3086342 by MegaChriz: Fixed $feed->getState() can return NULL...

Status: Fixed » Closed (fixed)

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