Affects Version/s: 6.0.X EE, 6.1.X EE, 6.2.X EE, 7.0.0 M7
A scheduled staging publish will not work next month if it is scheduled on the 30th
Original logic: dayOfMonth += StringPool.FORWARD_SLASH + interval;
Problem: If the day of the month is the 30th, we will create a cron interval of 30/1. Meaning run everyday starting on the 30th. So next month, the schedule will start on the 30th, rather than on the first.
Proposed Solution: Change to: dayOfMonth = 1 + StringPool.FORWARD_SLASH + interval;
So we start the interval on the first of the month.
Steps to Reproduce
- Start a clean bundle of Liferay 6.2 with the latest patch installed.
- Change the date on your computer to 6/30/2015.
- On the default site, enable local live staging (also reproduced in remote live).
- On the Staging site, click publish > Schedule > Enter date (6/30/2015) and the time for 5 minutes in the future.
- Select "Daily" to ensure the publish will occur at the specified time every day. Save.
- Add a web content display
- Change the date on your computer to 7/1/2015 (without restarting).
- Log back into the portal if needed.
- Wait for the scheduled publish time and then refresh the live site to see if the changes were published.
Expected Result: The publish will go through at the scheduled time.
Actual Result: The publish does not go through
Run a groovy script to note the "SchedulerEngineHelperUtil.getNextFireTime()" and note that after the first publish, it's next fire time is July 30th, rather than July 1st.
Branch 62x - fc0e3be7804c4453818eb2a1972717563eb41980: Reproduced
Master - 1dc5757b612c985268735dc6561efab4fe77004e: Reproduced