From b1420009f057c897c4ef6cae8f863ec642de5afe Mon Sep 17 00:00:00 2001 From: Hisam Mehboob <153192019+hissamshar@users.noreply.github.com> Date: Sat, 11 Jul 2026 18:47:31 +0500 Subject: [PATCH 1/2] scheduler: Fix typo in have_source check preventing default trays In commit 074526b0, the logic for checking whether a job already specified a paper source was refactored into the `have_source` boolean. However, the De Morgan's inversion for the `HPPaperSource` attribute was accidentally written as `== NULL` instead of `!= NULL`. This caused `have_source` to erroneously evaluate to `true` for almost all print jobs (since normal jobs never include the proprietary `HPPaperSource` attribute). As a result, the scheduler assumed the client had explicitly requested a tray, causing it to skip mapping the queue's `DefaultInputSlot` into the outgoing job options. This commit corrects the operator so that `have_source` correctly evaluates to `false` when no tray is specified, allowing IPP Everywhere printers to successfully receive their default tray assignments. Fixes #1636 --- scheduler/job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/job.c b/scheduler/job.c index d8e3c602b..df4e3f68c 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -3787,7 +3787,7 @@ get_options(cupsd_job_t *job, /* I - Job */ } have_size = ippFindAttribute(job->attrs, "PageRegion", IPP_TAG_ZERO) != NULL || ippFindAttribute(job->attrs, "PageSize", IPP_TAG_ZERO) != NULL; - have_source = ippFindAttribute(job->attrs, "InputSlot", IPP_TAG_ZERO) != NULL || ippFindAttribute(job->attrs, "HPPaperSource", IPP_TAG_ZERO) == NULL; + have_source = ippFindAttribute(job->attrs, "InputSlot", IPP_TAG_ZERO) != NULL || ippFindAttribute(job->attrs, "HPPaperSource", IPP_TAG_ZERO) !== NULL; have_type = ippFindAttribute(job->attrs, "MediaType", IPP_TAG_ZERO) != NULL; if (banner_page && (attr = ippFindAttribute(job->attrs, "job-sheets-col", IPP_TAG_BEGIN_COLLECTION)) != NULL) From ed01ca1a741c9dc8fd6af8fbff804c5f01e58a42 Mon Sep 17 00:00:00 2001 From: Hisam Mehboob <153192019+hissamshar@users.noreply.github.com> Date: Sat, 11 Jul 2026 19:03:12 +0500 Subject: [PATCH 2/2] Fix syntax error: !== is not valid C, use ! Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- scheduler/job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/job.c b/scheduler/job.c index df4e3f68c..85c4d0462 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -3787,7 +3787,7 @@ get_options(cupsd_job_t *job, /* I - Job */ } have_size = ippFindAttribute(job->attrs, "PageRegion", IPP_TAG_ZERO) != NULL || ippFindAttribute(job->attrs, "PageSize", IPP_TAG_ZERO) != NULL; - have_source = ippFindAttribute(job->attrs, "InputSlot", IPP_TAG_ZERO) != NULL || ippFindAttribute(job->attrs, "HPPaperSource", IPP_TAG_ZERO) !== NULL; + have_source = ippFindAttribute(job->attrs, "InputSlot", IPP_TAG_ZERO) != NULL || ippFindAttribute(job->attrs, "HPPaperSource", IPP_TAG_ZERO) != NULL; have_type = ippFindAttribute(job->attrs, "MediaType", IPP_TAG_ZERO) != NULL; if (banner_page && (attr = ippFindAttribute(job->attrs, "job-sheets-col", IPP_TAG_BEGIN_COLLECTION)) != NULL)