Hi,

I have the following lines (amongst others) in my config file for making a cronjob:
module: marktwacht
callback: marktwacht_check_opdracht
callback arguments: array('84','84')
pass job argument: TRUE

and the following function:

function marktwacht_check_opdracht($job, $args) {
...
}

When i run the cronjob I get the following error:
Too few arguments to function marktwacht_check_opdracht(), 1 passed and exactly 2 expected.

as you can see ive specified to pass the job argument and an extra argument (array). But for some reason it is not passed.
What am i doing wrong?

Kind regards,
Mark

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mark aka Dark created an issue. See original summary.

Mark aka Dark’s picture

Issue summary: View changes
umed91’s picture

@mark were you able to get this working?

Murz’s picture

@Mark can you describe where did you set callback arguments? I can't see such parameter in config/schema/ultimate_cron.schema.yml file.

e.bogatyrev’s picture

Hi everyone,
Please review the patch.
I suggest to use callback arguments as a string with line ending separation in the Cron Job configuration form since we don't actually know the final amount of them. It depends on the particular implementation of each callback. Then this string will be parsed, split to arguments and passed to callback.

Status: Needs review » Needs work

The last submitted patch, 5: ultimate_cron-callback-arguments-2909191-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

e.bogatyrev’s picture

e.bogatyrev’s picture

Status: Needs work » Needs review
nikolabintev’s picture

I just set it up on a project and it works well. I believe that this is e must-have feature.

nikolabintev’s picture

Status: Needs review » Reviewed & tested by the community