wp2static icon indicating copy to clipboard operation
wp2static copied to clipboard

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

Open zukilover opened this issue 10 months ago • 1 comments

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 avatar Feb 07 '25 00:02 zukilover

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

zukilover avatar Feb 07 '25 00:02 zukilover