Skip to content

Fix per-job cron schedule reverting when it matches the global default#1265

Draft
poonam279 with Copilot wants to merge 2 commits into
developmentfrom
copilot/fix-cron-schedule-reversion
Draft

Fix per-job cron schedule reverting when it matches the global default#1265
poonam279 with Copilot wants to merge 2 commits into
developmentfrom
copilot/fix-cron-schedule-reversion

Conversation

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

When a per-import cron schedule was set to the same value as the global default, it was silently discarded on save and the import fell back to "Once Daily" on reload.

Root cause

save_feedzy_import_feed_meta() unset fz_cron_schedule not only when empty, but also when it equalled the global schedule value — meaning an explicit per-job selection was never persisted if it happened to match the global setting.

// Before — incorrectly drops matching per-job schedules
$global_cron_schedule = ! empty( $this->free_settings['general']['fz_cron_schedule'] ) ? $this->free_settings['general']['fz_cron_schedule'] : '';
if (
    empty( $data_meta['fz_cron_schedule'] ) || $global_cron_schedule === $data_meta['fz_cron_schedule']
) {
    unset( $data_meta['fz_cron_schedule'] );
}

// After — only strip when not set
if ( empty( $data_meta['fz_cron_schedule'] ) ) {
    unset( $data_meta['fz_cron_schedule'] );
}

Changes

  • includes/admin/feedzy-rss-feeds-import.php — Remove the global-schedule equality check from the per-job schedule unset condition; the meta is now only discarded when empty, preserving any explicit per-job value regardless of what the global default is.

Copilot AI changed the title [WIP] Fix per-job cron schedule reverting to global default Fix per-job cron schedule reverting when it matches the global default Jun 24, 2026
Copilot AI requested a review from poonam279 June 24, 2026 11:31
@poonam279
poonam279 requested a review from Copilot June 24, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Feedzy’s import-job meta saving behavior so a per-import cron schedule selection is no longer discarded when it matches the global default, ensuring the chosen value persists across reloads.

Changes:

  • Stop unsetting fz_cron_schedule when it equals the global schedule; only unset when the value is empty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +669 to 671
if ( empty( $data_meta['fz_cron_schedule'] ) ) {
unset( $data_meta['fz_cron_schedule'] );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants