Site show old version of scrapbook

Permalink
I have a site in which a template uses 'Shared Scrapbook 1' to display a widget in the sidebar. Eg.
# Display 'UpperRight Sidebar' Block
  $ur = Block::getByName('UpperRight Sidebar');
  $ur->display('view', array());

The reason for this was so that all pages of the site could display information about an upcoming event, and when a new event is coming up, the scrapbook could be updated and the rest of the site would reflect the change.

However, when the scrapbook is updated, the site is still showing the old content. In the dashboard, the scrapbook shows the new content just fine. It seems as if the query that is part of 'getByName' does not differentiate between versions of the scrapbook, and is always pulling the first version instead of any updated versions.

Please help! I have checked the database, and sure enough, the scrapbook has two versions in there. We have only updated this particular widget once so far, am I going to get a large number of scrapbook versions? For now, I just modified the 'getByName' function to order the query results by cvID so that the most recent version is used...but this is most definitely a hack that will be overwritten by future updates.