Unable to Set Homepage for a Space
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
- The option to choose homepage in
Browse >> Space Admin >> Edit Space Details
is not selectable. Attempting to edit or remove this page causes the following error:
java.lang.NullPointerException at com.atlassian.confluence.pages.actions.AbstractCreateAndEditPageAction.setTitle (AbstractCreateAndEditPageAction.java:311) ...
An attempt to add the title and save the page results in the following error:
java.lang.NullPointerException at com.atlassian.confluence.pages.actions.EditPageAction.validate(EditPageAction.java:41) ...
Diagnosis
- The "Home" page is an orphaned page in space.
- There is also an additional orphaned page titled
$webwork.htmlEncode($content.displayTitle)
. This can be observed inBrowse >> Pages >> Tree View
.
Cause
See the following bug reports:
- CONFSERVER-17414 - Doc Import allows empty title (fixed in 3.3.1 and later)
- CONFSERVER-9319 - storePage succeeds in adding multiple pages with an empty string as a title, which can then not be accessed from the user Interface
Resolution
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Shutdown Confluence
Run the following SQL query to get a list of affected pages:
SELECT contentid FROM content WHERE title IS NULL AND contenttype='PAGE';
Rename the affected pages:
UPDATE content SET title='Your Title', lowertitle='your title' WHERE contentid in (SELECT contentid FROM content WHERE title IS NULL AND contenttype='PAGE');
- Restart Confluence
- Rebuild the index