I was trying to restore a version of content I am editing.
In the construct method of my administrator/components/com_joomprosubs/tables/subscription.php script, I added this following line:
JObserverMapper::addObserverClassToClass('JTableObserverContenthistory',
'JoomprosubsTableSubscription', array('typeAlias' => 'com_joomprosubs.subscription'));
This is based on what I have read in this link: https://docs.joomla.org/Using_Content_History_in_your_Component
However, when I try to restore a version, an error is displayed:
Error restoring item version from history.
The error is being returned due to the blank value of typeAlias
. I don't know where I got it wrong. From the code that I added above, I have included the typeAlias
with its corresponding value.
Has anybody tried adding versioning in their custom component?