backdrop-contrib / rules

Porting the Rules project to Backdrop CMS.
GNU General Public License v2.0
5 stars 10 forks source link

Rules Scheduler: task list is missing #215

Closed bugfolder closed 4 months ago

bugfolder commented 4 months ago

On the Schedule tab of the Rules Scheduler sub-module, at admin/config/workflow/rules/schedule, even after you have scheduled a task, there are no tasks listed:

image

However, they're there in the D7 version of Rules:

image

We should restore this table to the Backdrop Rules Schedule page.

bugfolder commented 4 months ago

Well, that was easy. The Rules Schedule view was missing.

image

It's typically brought over with a D7 upgrade, but is missing from new installs. Looks like we need a config file in rules_scheduler module and an update hook for existing installations.

argiepiano commented 4 months ago

Thanks @bugfolder - please see comments in the PR.

argiepiano commented 4 months ago

Thanks for the changes. I still am unsure if reading a file in an update hook is a good idea. I guess we'll find out. The PR worked fine in my very basic testing. LGMT.

bugfolder commented 4 months ago

I still am unsure if reading a file in an update hook is a good idea.

I think the main difference would be that if we someday update the default View in config, when we're reading it in from the file, the update hook will get the new version, whereas if we duplicated its content in the update hook, then even after updating the default view, updates would get the old one (unless we updated the update hook, or added a new update hook).

Under the DRY principle, seems like reading it in from the file in the update hook ismore robust than putting the same long, complex block of code in two places.

Since both backdrop_get_path() and backdrop_json_decode() are in common.inc, we can count on them being available to update hooks.