Patch fixes 2 problems with item expiry notification -
conditions for creation of a notification phase, and urls
in notification emails.
1. Currently, a notification email is sent out provided
there is an advance notification period, and that an end
date has been entered on the publishing screen. The
trouble is, if you apply a lifecycle that has an end date,
the end date field is not populated, and so unless the
user overrides the lifecycle default end, then no
notification phase is created.
Ideally, I think the start and end date fields should be
prepopulated according to the delay and duration of the
selected lifecycle, but this would need to be done with
javascript and the delay and duration of each lifecycle
definition sent to the browser so a javascript function
could update start & end date fields whenever the user
chooses a different lifecycle from the drop down.
For the time being, I have just changed the condition so
that if there is an advance notification period, and there
is an end to the lifecycle then a notification phase is
added.
Another oddity in the existing code is that if a user
enters a lifecycle end date, then the application
retrieves all phases for the lifecycle, and replaces their
end date with the user specified end date if that is
earlier than the phase end. However, it doesn't look at
phase start date - in a multiple phase lifecycle, or one
with a delay you could get a phase that ends before it
starts. I think the listeners would probably handle that
but it's a bit odd, so I have changed it so that the start
date is potentially brought forward to coincide with the
end.
2. Notification email contains 2 links, but both are
currently broken.
Link to article at the front end uses a path that is not a
valid url location because it includes both the content
bundle name and the content item name. I have
changed this to return the path to the content bundle - I
was going to use the stable link format, but because
stable links include characters that are not valid in a url
(curly brackets in the oid) mail clients don't render it as
a link.
Link to the article in the back end was referring to the
live item id, which is not an editable item and so just
returns an error. This now refers to the draft id.
Patched on 1.0.2 release