Beware the Page Template Bug

Publisher by matt on April 30th, 2007 No Comments

In the ALUI 6.1 Portal (reproduced in at least 6.1.240495 (Java) and 6.1.0.235226 (.NET) ), there’s a bug that basically prevents you from creating pages based off of Page Templates. If you create a page created from a Page Template and inherit the template, you’ll notice the portlets don’t show up “greyed out” like they should. The portal actually allows you to move and edit the portlets that should be “fixed in place” by the template:

Page Template Bug - Creating a Page

Once you save the page and try to go back in to edit it, you see the portlets are “messed up” and you get an error when you try to save the page:

Page Template Bug - Modifying a Page

PTSpy shows something like this:

"Error - An unexpected error occurred when trying to save this page.".
The extended error info is "
<!--Extended Error Message: An unexpected error occurred when trying to finish this
editor.-2147467259 - Error in function PTPage.AssignPortlets (arrPortletIDs ==
System.Int32[], nColumn == 0): -2147467259 - Error: list of portlets must be unique.
Duplicates were found.-->"

The reason for this is that when the page was created, the portal saved these porlets in the PTPAGEGADGETS table (i.e., as a portlet on the page), but the portlets also exist in the template itself. So the page editor is trying to show double instances of the portlets, and won’t let you save the page with those double instances (yet won’t let you delete them either). This bug should be fixed in the latest version of the portal, but I haven’t confirmed it. If you absolutely can’t upgrade, some SQL like this* may do the trick, substituting the proper template ID in for the NNN:

DELETE from ptpagegadgets
WHERE EXISTS
(SELECT gadgetid
FROM PTPAGES p
WHERE PAGETEMPLATEID=NNN
AND ptpagegadgets.pageid = p.objectid
AND ptpagegadgets.gadgetid IN
(SELECT gadgetid
FROM PTPAGETEMPGADGETS
WHERE pagetempid=NNN) )
)

* This SQL removes all extraneous portlets that exist in the page template specified from the PTPAGEGADGETS. It may cause unexpected results in some circumstances, such as if you’ve used those portlets on OTHER pages not created by this template, so use at your own risk. A much safer route would be to upgrade or contact aluisupport@bea.com.

No Responses to “Beware the Page Template Bug”

Leave a Reply

You must be logged in to post a comment.