Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jobs are queued after saving a post even though the option is disabled #918

Open
zukilover opened this issue Feb 7, 2025 · 1 comment
Open

Comments

@zukilover
Copy link

When saving a post, it automatically queue jobs even when the queueJobOnPostSave option is disabled.

To Reproduce

  1. Go to the Jobs Settings
  2. In the 'Events to queue new jobs' disable 'Queues a new job every time a Post or Page is saved.'
  3. Click Save Job Automation Settings
  4. Go to a post, and save
  5. Notice that jobs are queued after saving the post.

Expected behavior
Jobs must not be queued after saving a post when the queueJobOnPostSave is disabled.

Environment (please complete the following information):

  • WP2Static 7.2
@zukilover
Copy link
Author

It looks like the option is always overridden by this line:

if ( ! $option_value || ! is_string( $option_value ) ) {
$option_value = (string) $opt_spec['default_value'];
}

Since queueJobOnPostSave is 0 when disabled, it tries to use the default value which is 1:

self::makeOptionSpec(
'boolean',
'queueJobOnPostSave',
'1',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant