I turned on SQL debugging in hibernate. No query is ever executed to get the object when I click so it looks like somewhere its caching a bogus object.
I found this SQL where it creates the moodle assignment tool
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.SQL - update tl_mdasgm10_md
lassignment set create_date=?, update_date=?, define_later=?, content_in_use=?,
run_offline=?, tool_content_id=?, ext_tool_content_id=?, ext_user_name=?, ext_co
urse_id=?, ext_section=?, ext_lms_id=? where uid=?
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.jdbc.AbstractBatcher - prep
aring statement
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.persister.entity.BasicEntit
yPersister - Dehydrating entity: [org.lamsfoundation.lams.tool.mdasgm.model.MdlA
ssignment#8]
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.TimestampType - bindin
g '2009-07-08 16:29:19' to parameter: 1
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.TimestampType - bindin
g null to parameter: 2
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.BooleanType - binding
'false' to parameter: 3
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.BooleanType - binding
'false' to parameter: 4
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.BooleanType - binding
'false' to parameter: 5
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.LongType - binding '25
56' to parameter: 6
and its setting the tool_content_id when it inserts the tool.
More from hibernate log
16:29:19,034 [http-0.0.0.0-80-2] DEBUG org.hibernate.pretty.Printer - org.lamsfo
undation.lams.tool.mdasgm.model.MdlAssignment{uid=8, extToolContentId=null, cont
entInUse=false, toolContentId=2556, extUsername=sgadmin, updateDate=null, runOff
line=false, extLmsId=moodle, extCourseId=7, mdlAssignmentSessions=[], extSection
=68, defineLater=false, createDate=2009-07-08 16:29:19}
Posted by Dave Bauer