Closed (fixed)
Project:
Feeds
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 May 2025 at 22:35 UTC
Updated:
19 May 2026 at 15:45 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #2
no sssweat commentedComment #3
no sssweat commentedHere is a patch, I tested it so it would still work even if someone changes the Next import date format in Manage Display.
Comment #4
no sssweat commentedRe-rolled the patch, my IDE accidentally modified some of the spacing up top.
Comment #5
no sssweat commentedComment #6
no sssweat commentedUpdated conditional so it's compatible with any timezone.
Comment #8
megachrizIt depends on the current user time zone for how the date is displayed. For example, I have for one feed displaying the following:
I think it is better to fix this in FeedViewBuilder and replace the date with the text 'Not scheduled'. This is also consistent with how a similar issue was fixed in the D7 version of Feeds.
It will then look like this:

Comment #10
megachrizI think it would be good to add tests for this. The tests should cover the following:
Since I think that case 3 is currently not working, setting this issue to "Needs work".
Comment #11
megachrizI think the fix and the tests are good enough.
Comment #12
benstallings commentedClaude Code says,
Issues
1. Missing use statement in FeedViewBuilder
The PHPCS fix commit (4a3969cf) removed the use Drupal\feeds\ScheduledFeedInterface import from FeedViewBuilder.php. But the class references ScheduledFeedInterface at line 60:
if ($feed instanceof ScheduledFeedInterface) {This works because Feed is in the same Drupal\feeds namespace, so PHP resolves the unqualified class name. But it's inconsistent — other classes like Feed.php correctly import ScheduledFeedInterface. The use statement should be restored; the PHPCS tool likely flagged it incorrectly because it didn't detect the instanceof usage.
2. Unused $key in the foreach loop
FeedViewBuilder.php:56:
foreach ($builds as $key => &$build) {$key is never used. PHPCS or PHPStan may flag this. Consider foreach ($builds as &$build).
3. Test docblock typo
ImportPeriodTest::testDisplayNextImportWithPeriodicImportOff():▎ "Tests not scheduled feed should not display a data."
Should be "Tests that an unscheduled feed does not display a date."
4. Commit ordering creates a broken intermediate state
Same pattern as the other branches: the test commit (f425d5cc) asserts the fixed behavior, but the fix commit (2842a157) comes after it. At commit f425d5cc, the tests would fail. Should be squashed or reordered.
5. Consider: isScheduled() returns true for queued inactive feeds
If a feed is deactivated while it's queued, isScheduled() returns TRUE because the queued check comes first. This matches the test testDisplayNextImportWhenSchedulingManuallyForInactiveFeed — a manually scheduled inactive feed should say "On next cron run". This is correct behavior, but worth a brief comment explaining the intentional priority, since it's a subtle edge case.
What looks good
- Test coverage is thorough: 5 functional tests covering the main scenarios — scheduled, periodic-off, manually scheduled, inactive+queued, inactive+future-time. The 1969/1970 assertions are a nice touch to guard against epoch-date display bugs.
- The constant replacement in feeds_cron() (-1 → SCHEDULE_NEVER) is a good cleanup.
- The interface is appropriately scoped — single method, clear contract, doesn't over-abstract.
- The isScheduled() logic correctly handles the interaction between queued state, active state, and the SCHEDULE_NEVER sentinel.
Summary
This is a clean, well-scoped fix. The core logic is correct, the test coverage is good, and the architecture (new interface + view builder integration) is sound. The issues are minor — a likely-wrong use removal in the PHPCS commit, a typo, and commit ordering. Should be straightforward to merge after cleanup.
Comment #13
benstallings commentedComment #14
benstallings commentedComment #15
megachrizThanks for testing and the feedback. I've scheduled the merge.