wp2static
wp2static copied to clipboard
Jobs are queued after saving a post even though the option is disabled
When saving a post, it automatically queue jobs even when the queueJobOnPostSave option is disabled.
To Reproduce
- Go to the Jobs Settings
- In the 'Events to queue new jobs' disable 'Queues a new job every time a Post or Page is saved.'
- Click Save Job Automation Settings
- Go to a post, and save
- 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
It looks like the option is always overridden by this line:
https://github.com/elementor/wp2static/blob/f06790a5e65c73a7f3cc293f5652004dd21d3796/src/CoreOptions.php#L407-L409
Since queueJobOnPostSave is 0 when disabled, it tries to use the default value which is 1:
https://github.com/elementor/wp2static/blob/f06790a5e65c73a7f3cc293f5652004dd21d3796/src/CoreOptions.php#L128-L131