click here for details... Sakai Executive Director Position Search now open
Issue Details (XML | Word | Printable)

Key: SAK-11562
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: casey dunn
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Sakai

Section Info sakai_event posting of new sections always null in REF field

Created: 18-Sep-2007 10:26   Updated: 27-Oct-2009 13:39
Component/s: Section Info
Affects Version/s: 2.4.x, 2.5.0
Fix Version/s: 2.4.x, 2.5.2, 2.6.0

Time Tracking:
Not Specified

File Attachments: 1. File sak-11562-sakai-2-4-x.diff (1.0 kB)


2.6.x Status: None
2.5.x Status: Resolved
2.4.x Status: Resolved


 Description  « Hide
One of our local tools is listening for sakai_events referring to Sections.

when a section is manually added, this code:

// Save the site, along with the new section
try {
siteService().save(site);
for(Iterator<CourseSection> iter = sections.iterator(); iter.hasNext();) {
postEvent("section.add", iter.next().getUuid());
}
return addedSections;
} catch (IdUnusedException ide) {
log.error("Error saving site... could not find site " + site.getId(), ide);
} catch (PermissionException pe) {
log.error("Error saving site... permission denied for site " + site.getId(), pe);
}
return null;

posts the event section.add for the new section, but the REF field is always NULL.

The sections object used in the iterator contains sections w/out uuids.

Solution:
Change the object iterated to addedSections and the sakai_event table entry will get the correct value for REF, as this code intended.

 All   Comments   Work Log   Change History   Subversion Commits   git Commits      Sort Order: Ascending order - Click to sort in descending order
Stephen Marquard added a comment - 26-Sep-2007 02:05
Still an issue in trunk. This means SiteStats can't process this event, inter alia.


Stephen Marquard added a comment - 22-Jan-2008 11:53
Sitestats error for reference:

WARN: Unable to parse contextId from event: section.add | (2008-01-22 20:45:18,996 org.sakaiproject.sitestats.impl.StatsUpdateManagerImpl_org.sakaiproject.sitestats.impl.StatsUpdateManagerImpl)
java.lang.ArrayIndexOutOfBoundsException: 2
        at org.sakaiproject.sitestats.impl.StatsUpdateManagerImpl.parseSiteId(StatsUpdateManagerImpl.java:744)
        at org.sakaiproject.sitestats.impl.StatsUpdateManagerImpl.preProcessEvent(StatsUpdateManagerImpl.java:355)
        at org.sakaiproject.sitestats.impl.StatsUpdateManagerImpl.run(StatsUpdateManagerImpl.java:303)
        at java.lang.Thread.run(Thread.java:595)

Stephen Marquard added a comment - 01-May-2008 10:49
Resolved in r46004 and tested on local trunk build.

Pls merge to 2-5-x.

David Horwitz added a comment - 06-May-2008 06:47
merged into 2-5-x with r46166

SOO IL KIM added a comment - 10-Jun-2008 12:46
I sensed this issue has not been merged to 2.4.x. So I investigated a bit. It seems fix(patch) is pretty simple and easy though. I don't know how to reproduce the error in not-yet-patched sakai (e.g. http://nightly2.sakaiproject.org:8081/portal)

BTW, I attached the patch for 2.4.x

Ok I have tested this by watching the sakai_event table before and after the code modification and can verify this fix:

before:
60 2008-06-19 00:03:59 section.add NULL 56014ab5-ec6d-409d-80f2-938be57a5288 m

after:
99 2008-06-19 00:16:37 section.add /site/70789f0e-98c8-4504-003d-a2d4cf32c461/group/28a0feb3-ec85-48eb-0067-72288c39962b 05e00144-5e53-4f29-8091-ffbca80f0ef9 m

I have also edited the initial description/title to make it a bit clearer what was going on.

Have merged to 2.4.x branch:
svn commit -m "
SAK-11562: sakai_event posting of new sections always null in REF field" sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionManagerImpl.java
Sending sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionManagerImpl.java
Transmitting file data .
Committed revision 47644.

Will reassign to Nuno to check if this is going to mess up SiteStats.


Nuno Fernandes added a comment - 19-Jun-2008 02:37
Steve, this is working perfectly and SiteStats is handling it well! (tested on updated local trunk instance).