$installdefs parameter schedulers in manifest.php is not respected as documented while installing a module #5184

Open
opened 2026-02-20 16:31:04 -05:00 by deekerman · 1 comment
Owner

Originally created by @isleshocky77 on GitHub (Apr 15, 2024).

Issue

The documentation Module Installer states that there is a key for schedulers which would be

An array of schedulers to be installed. Each entry is an array with a single key:

This means that these should be copied to the schedulers directory.

However, in practice, this functionality does not work.

If you look at the $manifestMap in ModuleInstall/ModuleScanner.php:51 as well $tasks ModuleInstall/ModuleInstaller.php:123 you'll see there isn't actually a definition for schedulers or a install_schedulers task.

The work around for this is you need to use the copy key like such

    'copy' => [
        [
            'from' => '<basepath>/schedulers/CustomModule.php',
            'to' => 'custom/Extension/modules/Schedulers/Ext/ScheduledTasks/CustomModule.php',
        ],
    ],

Expected Behavior

When installing a custom module with a manifest.php file that has a key for schedulers, it should install the Scheduler. as documented.

Actual Behavior

The key schedulers key in manifest is just ignored.

Possible Fix

Add the correct functionality to ModuleInstall/ModuleScanner.php:51 and ModuleInstall/ModuleInstaller.php:123

Steps to Reproduce

  1. Create a Custom module
  2. Update the manifest.php to have an array with a key of schedulers
  3. Create in the module a Scheduler
  4. Install the custom module through Module Loader
  5. Look at scheduled jobs

Context

The documentation is wrong and takes a bit of debugging to figure out. You then need to use the copy key instead of a cleaner schedulers key for what is actually going on.

Your Environment

  • SuiteCRM Version used: 7.x
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): 123.0.6312.86
Originally created by @isleshocky77 on GitHub (Apr 15, 2024). <!--- Provide a general summary of the issue in the **Title** above --> <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> <!--- Please be aware that as of the 31st January 2022 we no longer support 7.10.x. New issues referring to 7.10.x will only be valid if applicable to 7.12.x and above. If your issue is still applicable in 7.12.x, please create the issue following the template below --> #### Issue <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> <!--- Ensure that all code ``` is surrounded ``` by triple back quotes. This can also be done over multiple lines --> The documentation [Module Installer](https://docs.suitecrm.com/developer/module-installer/#:~:text=in%20the%20install.-,schedulers,-An%20array%20of) states that there is a key for `schedulers` which would be > An array of schedulers to be installed. Each entry is an array with a single key: This means that these should be copied to the `schedulers` directory. However, in practice, this functionality does not work. If you look at the `$manifestMap` in `ModuleInstall/ModuleScanner.php:51` as well `$tasks` `ModuleInstall/ModuleInstaller.php:123` you'll see there isn't actually a definition for `schedulers` or a `install_schedulers` task. The work around for this is you need to use the `copy` key like such ```php 'copy' => [ [ 'from' => '<basepath>/schedulers/CustomModule.php', 'to' => 'custom/Extension/modules/Schedulers/Ext/ScheduledTasks/CustomModule.php', ], ], ``` #### Expected Behavior <!--- Tell us what should happen --> When installing a custom module with a `manifest.php` file that has a key for `schedulers`, it should install the Scheduler. as documented. #### Actual Behavior <!--- Tell us what happens instead --> <!--- Also please check relevant logs (suitecrm.log, php error.log etc.) --> The key `schedulers` key in manifest is just ignored. #### Possible Fix <!--- Not obligatory, but suggest a fix or reason for the bug --> Add the correct functionality to `ModuleInstall/ModuleScanner.php:51` and `ModuleInstall/ModuleInstaller.php:123` #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Create a Custom module 2. Update the `manifest.php` to have an array with a key of `schedulers` 3. Create in the module a Scheduler 4. Install the custom module through Module Loader 5. Look at scheduled jobs #### Context <!--- How has this bug affected you? What were you trying to accomplish? --> <!--- If you feel this should be a low/medium/high priority then please state so --> The documentation is wrong and takes a bit of debugging to figure out. You then need to use the `copy` key instead of a cleaner `schedulers` key for what is actually going on. #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.x * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): 123.0.6312.86
Author
Owner

@jobst commented on GitHub (Apr 22, 2025):

I just saw this as I am trying, too, to work out how to create scheduled jobs with MINIMAL follow ups required by the admin of a site.

As developers (I am creating a couple of modules one of which implements a caldav server) I should be able to create a number of scheduler jobs (e.g. once a day at 1am or every 15minutes) without ANY setup required by an admin.

The Module documentation explains how to do this, the code however does not implement what is explained in the documention (running the LATEST 7.14.6)

@jobst commented on GitHub (Apr 22, 2025): I just saw this as I am trying, too, to work out how to create scheduled jobs with MINIMAL follow ups required by the admin of a site. As developers (I am creating a couple of modules one of which implements a caldav server) I should be able to create a number of scheduler jobs (e.g. once a day at 1am or every 15minutes) without ANY setup required by an admin. The Module documentation explains how to do this, the code however does not implement what is explained in the documention (running the LATEST 7.14.6)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5184
No description provided.