Details
Description
All lessons event refs are in the following format:
"/lessonbuilder/[page|item|comment]/<ID>"
The middle chunk of the ref determines what type of object the event is referring to; either a SimplePage, SimplePageItem, or SimplePageComment.
However, there is a problem in the code for the "lessonbuilder.read" events. These events can refer to either a SimplePage or a SimplePageItem, however the code always builds the event ref with the "/page/" identifier.
Due to the way IDs are used in Lessons, it becomes impossible to determine if this event refers to a SimplePage or a SimplePageItem, because the IDs for both are just incrementing integers. So you could very well have both a SimplePage and a SimplePageItem with the same ID.
There is code already in Lessons to determine the correct object the event refers to, but when building the event ref it always just sticks the "/page/" part in there regardless. This is a bug. It should be using the "/page/" OR "/item/" part depending on what object is being operated on. The solution is very simple, it's just two lines.