Closed jonasraoni closed 1 year ago
I've created an issue at the Laravel repository https://github.com/laravel/framework/issues/46355
@jonasraoni, what are the reproduction steps to cause this? (This will help determine whether it's a must-fix for 3.4 or can wait on Laravel's schedule.)
This has been resolved in PHP 8.1+ but an issue before that, see the test at https://onlinephp.io/c/dbcd1 . The best solution for this is to extract the code within the Queue::push()
to a separate job class and pass an instance of that to Queue::push()
.
Yep, the Laravel folks said the same and asked for a fix: https://github.com/laravel/framework/issues/46355
Perhaps I'll create a PR later (e.g. $job instanceof Closure
).
Might be useful for this issue:
BULK_EMAIL_SIZE_LIMIT
const, which is now in Mailer
: https://github.com/pkp/pkp-lib/blob/main/classes/mail/Mailer.php#L46 @NateWr can you please review the PRs . The bulk emailing feature now handled by batch queue process with few enhancements .
@Vitaliy-1 can you code review this? I worked on this back before all of @touhidurabir's work on jobs and your work on emails. I think you're more familiar with best practices here.
A fix has already been added upstream, so the next release of Laravel 9 should include it :)
@touhidurabir, looks good! I also think that the separate API endpoint to process the queue isn't needed anymore as the concept has changed. I left a comment, can you check whether we duplicate registering of the database connector with this PR?
@Vitaliy-1 I have replied to your reviews, please check those .
Thanks, @touhidurabir. Think that it's ready to be merged after the tests.
Describe the bug See error log below, the origin is here: https://github.com/pkp/pkp-lib/blob/566c546eccc8be374181172412803a06695ec9dc/api/v1/_email/PKPEmailHandler.php#L168
And fails due to this bug in Laravel (you cannot call
isset($closure->property)
on a closure): https://github.com/laravel/framework/blob/ab7586b3b7303958f343c84531b021b1055bd6a3/src/Illuminate/Queue/Queue.php#L328Re-production Steps
Administration --> Site Settings --> Bulk Emails --> Select specific context --> Save
Context(Journal/Server/....) --> User & Roles --> Notify
What application are you using? OJS 3.4.0 RC1
Additional Information Details reason at https://github.com/pkp/pkp-lib/issues/8734#issuecomment-1471632392
PRs pkp-lib --> https://github.com/pkp/pkp-lib/pull/8827 ui-library --> https://github.com/pkp/ui-library/pull/270 ojs --> https://github.com/pkp/ojs/pull/3838 [TEST ONLY]