Closed (fixed)
Project:
Ultimate Cron
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Nov 2024 at 19:51 UTC
Updated:
9 Dec 2024 at 07:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
classiccut commentedPatch that explicitly declares type and key as public member properties.
Comment #3
narkoff commentedHad same issue. Patch resolved warnings.
Comment #4
crawleyde commentedThis solves many deprecated function warnings for me as well. Thank you.
Comment #6
arnested commentedThank you for the patch!
It has been committed and released in the 7.x-2.10 release.
Comment #7
classiccut commentedAmazing! Thanks for the quick turnaround. Much appreciated.
Comment #8
arnested commentedA good patch makes a difference 🥰
Comment #9
narkoff commentedEven after adding this patch, I still have the following message in my logs:
Deprecated function: Creation of dynamic property UltimateCronJob::$sort is deprecated in ultimate_cron_run_launchers() (line 1643 of /code/sites/all/modules/ultimate_cron/ultimate_cron.module).
Should this patch have addressed this too?
Comment #10
arnested commentedProbably, @narkoff.
Does this patch work?
Comment #11
narkoff commentedThank you, @arnested.
Yes, patch in #10 works. But I noticed I was also getting messages for $disabled, $hook, $table, $description, $title, $export_type, $name, $jid, $type, $progress, $lock_id, $log_entry. Adding these to class UltimateCronJob worked.
Or, the other option is to add
#[\AllowDynamicProperties]in front of the class (though I assume explicitly defining all dynamic properties is better).Comment #12
arnested commentedYes, I think adding the properties are the way forward.
On the other hand, Drupal 7 is soon too be unsupported. So I think both approaches are valid now.
Would you mind creating a patch?
I'm not using Drupal 7 anymore myself, so I would just end up blindly adding what you suggest anyway :)
Comment #13
arnested commentedMaybe a combination?
This patch declares the properties that are actually used in the class itself.
And then it declares AllowDynamicProperties for all the other properties to not emit warnings.
Comment #14
narkoff commentedThis adds all properties that were generating messages to the UltimateCronJob and CropRule classes.
Comment #16
arnested commentedThank you for the patch, @narkoff.
I have committed it and released it as version 7.x-2.11.