#1199: metadata/DefaultStatusActions.java:processList() doesnt send the e-mail to
all users
----------------------------+-----------------------------------------------
Reporter: landry | Owner: geonetwork-devel@…
Type: defect | Status: new
Priority: major | Milestone: v2.9.0
Component: Catalog server | Version: v2.8.0RC2
Keywords: |
----------------------------+-----------------------------------------------
When changing a metadata status from unknown to submitted, some mails
should be sent by the catalog to all reviewers. What i'm seeing instead is
:
- the first reviewer in the list doesnt receive an e-mail
- all the others receive a mail
- the last reviewer receives a dupe of the mail
with the given sql request made by am.getContentReviewers() in
informContentReviewers()
{{{
SELECT m.id as metadataid, u.id as userid, u.name as name, u.surname as
surname, u.email as email from Metadata m JOIN UserGroups ug on
m.groupOwner = ug.groupId JOIN Users u on u.id = ug.userId WHERE m.id=282
and u.profile='Reviewer' order by u.id;
}}}
say i get a list with a@...938..., b@...938... and c@...938... as email field.
a@...938... will receive nothing, b@...938... will receive a mail, and
c@...938... will receive two mails.
I've tracked it down to processList() in
metadata/DefaultStatusActions.java - which logic seems bogus. When that
chunk :
{{{
if (mIds.size() > 0) { // send out the last one
sendEmail(email, subject, status, changeDate, changeMessage);
}
}}}
is reached, 'email' still contains the e-mail of the last reviewer in the
userList.
What was the intent of the strange
{{{
if (!id.equals(lastUserId) && !first) { // send out list
}
}}}
test to avoid sending a mail to the first e-mail ? avoid duplicates ?
Also, why storing mIds/mid/id/lastUserId ?
To me, the thing could be greatly simplified as this :
{{{
for (Element user : userList) {
email = user.getChildText("email");
sendEmail(email, subject, status, changeDate, changeMessage);
}
}}}
Unless there's something obvious i'm missing, i dont understand why the
function is so complicated..
--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1199>
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/>
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.