Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Update descriptions of StreamOnly Item Elements when Installing or Updating the plugin #40
When the plugin is uninstalled, all Items of Item Type "StreamOnly" are set to "undefined" Item Type (NULL), but the Item Type Elements associated with Item Type "StreamOnly" are left in place, as are all the Item Type Element Texts associated with the Items.
While the Items are of "undefined" Item Type, the Item Type Elements associated with "StreamOnly" Item Type are not displayed when the Item is edited. They can be accessed, however, if the user sets the Item to a defined Item Type (e.g. "TempStreamOnly") and assigns the desired Item Type Elements to that Item Type. The information in the Item Type Element Texts is not known to be used by any of the Omeka code, but it can then be viewed and updated.
Currently, if the plugin is re-installed, it detects that the "StreamOnly" Item Type Elements already exist, and skips over creating them. Thus the Item Type Element still has the same id, and the Item Type Element Texts associated with each Item restored to Item Type StreamOnly are still properly associated with the Item Type Element and the Item.
Skipping over the creation of the Item Type Element prevents the description from being updated. This could be rectified by separating the list of Item Type Elements created during installation into two lists: one for those which are associated with Item Type "Sound", and one for those that are specific to the Item Type "StreamOnly". For the latter, the new descriptions could overwrite the existing ones.