Closed (fixed)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jan 2023 at 08:05 UTC
Updated:
11 Jul 2023 at 17:27 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
megachrizCan you give more information about the source you were trying to import and how the the feeds importer looks like?
Can it be that the source was completely empty? That would be my first guess. Because assuming it is about
$state->removeList, that variable gets set inFeedsProcessor::process(), but maybe there is a situation whereFeedsProcessor::process()never gets called?Comment #3
tormiMegaChriz, you're correct - the source was completely empty :)
Should I close the issue or should we check if
$state->removeListis countable (and give some feedback if not)?Comment #4
megachrizI think this is worth to fix. What I think we need to do is:
$state->removeListis not null before proceeding further.I thought too about that the clean stage should perhaps be entirely skipped (so no calls to
clean()would happen) when the source is empty, but there there is also a feature request for cleaning data in that case: #2333667: Add an option to delete all nodes when the feed source is empty.Comment #5
dsnopekHere's a patch to fix this error
Comment #6
megachrizHere is a patch with tests.
Comment #7
cboyden commentedThere's another instance of the potential PHP error in FeedsNodeProcessor.inc. I've attached an updated patch that includes this.
Comment #9
nathan tsai commented#7 Worked for me (although I don't know why the tests are not passing)
Comment #10
megachrizThe patch in #7 fails tests because the file "empty.csv" is missing:
I hope to finalize this issue soon!
Comment #12
bharath-kondeti commentedAddressing #10.
Comment #13
nathan tsai commented@bharath-kondeti, did you intentionally leave out the tests that were in #6 and #7?
Comment #14
nathan tsai commentedAlso, on a side note: When using Feeds Extensible Parsers, an empty response still results in no nodes being deleted or unpublished.
E.g. I have 10 nodes with the feed importer setting "Delete missing nodes". If I then delete all of them (and thus, the response is empty), none of the nodes are deleted.
Don't know if this issue belongs here or on the Feeds Extensible Parsers module.
Comment #15
bharath-kondeti commented@Nathan Tsai
I have missed them, while creating the patch. I will hide the file from #12. Here is the updated patch.
Comment #16
bharath-kondeti commentedThe patch seems to be not failing more test cases. Let me re-work.
Comment #18
megachrizI committed #6 with the additional change from #7 included.
Comment #19
megachriz@Nathan Tsai
For your issue there exist an other open issue: #2333667: Add an option to delete all nodes when the feed source is empty
It is intentional that an empty source doesn't delete everything - to account for the situation where the source was temporary unavailable. The issue there is marked RTBC, but it still needs tests to be accepted.
Comment #21
nathan tsai commented@MegaChriz, thank you for pointing that out. I did not realize that feeds do not import nodes when the response is empty or there are no items.
For future reference, I added the following code for my REST Export to ensure there is always at least one item in my response.
Comment #22
nathan tsai commentedComment #23
nathan tsai commentedOh wait, my issue was technically different. Removing the "related" issue.