If you're restoring a WikiPage from Trash while using Site Templates and Site Pages, an error 'Duplicate entry for key IX_21277664' is shown in logs.
Additionally, in master, Wiki Portlet shows the message "Portlet is temporarily unavailable.".
Steps to reproduce:
1.- Start Liferay
2.- Create a Site Template (from now on, mySiteTemplate)
3.- Create a Page Template (from now on, myPageTemplate) and choose don't apply changes automatically.
4.- In mySiteTemplate, add a wiki. And then add a wikipage (from now on, myWikiPage).
5.- In mySiteTemplate, add a Page based on myPageTemplate, and over it, add a WikiDisplay portlet, and go to configuration to show the node related to the wiki created previously.
6.- Create a new Site based on mySiteTemplate (from now on, mySite)
7.- Go back to mySiteTemplate, and send to trash myWikiPage. Do some additional change, like the color scheme.
8.- Go to mySite and see the color scheme has changed, but myWikiPage is still there. Send it to trash.
9.- In mySite, create a new WikiPage with the same title than myWikiPage.
10.- Go to mySiteTemplate, restore myWikiPage from trash, and do some additional change, like the color scheme.
11.- Access to mySite.
Everything is fine.
Master: "Portlet is temporarily unavailable" is shown in Wiki Portlet, and error related to IX_21277664 appears in logs
6.2.x: The color scheme has changed, but if you check the logs you'll see an error related to duplicates entries for indexes IX_3D4AF476 and IX_21277664