Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newPrintTask() uses uninitialized $contentType with Cups Driver #102

Open
wgnann opened this issue Mar 12, 2025 · 0 comments
Open

newPrintTask() uses uninitialized $contentType with Cups Driver #102

wgnann opened this issue Mar 12, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@wgnann
Copy link

wgnann commented Mar 12, 2025

Laravel Printing Version

Commit 76ef855

Laravel Version

v8.83.27

Print Driver

Cups

Bug description

Hello,

When using:

$printJob = CupsPrinting::newPrintTask()
    ->printer($id)
    ->file($this->printing->filepath_processed)
    ->send();

just as told in README.md, the send() uses PrintTask's $contentType attribute uninitialized. The method ensureValidJob() expects $contentType to be defined.

Reading the code, $contentType seems to be defined when the method content(...) is called. But I think it is not called anywhere (at least using the example). The method that fills $content seems to be the base PrintTask's file().

Steps to reproduce

Use Cups Driver to print anything.

Relevant log output

Typed property Rawilk\Printing\Drivers\Cups\PrintTask::$contentType must not be accessed before initialization
@wgnann wgnann added the bug Something isn't working label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant