[SAK-15504] Upgraded site: editing My workspace leads to duplicate Home Created: 26-Jan-2009  Updated: 30-Jun-2014  Resolved: 14-May-2009

Status: CLOSED
Project: Sakai
Component/s: Site Info
Affects Version/s: 2.6.0
Fix Version/s: 2.6.0, 2.7.0

Type: Bug Priority: Blocker
Reporter: David Horwitz Assignee: Zhen Qian
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


On an instalation upgraded from 2-5-x to 2-6-x. If a user edits their "My Workspace" site through Worksite Setup->Edit->Edit tools

1) Get presented with an unchecked "Home" button
2) Checking this leads to a secong "home" tool being added to the site.

I suspect this has to do with a change to how Site Info identifies the home page thats missing from the 2-6-x conversion

Comment by Zhen Qian [ 26-Jan-2009 ]


I don't see this problem from 2-6-x nightly build.

What type of tools are in the "Home" page in your build?


  • Zhen
Comment by David Horwitz [ 26-Jan-2009 ]

Hi Zhen,

Yeah - I think it would need to be an instance from a upgraded databse. A typical example:




e1855d5b-4faf-479d-00d1-d14a9e26a451 ~dhorwitz Home 1 1 0

With the following tools;




09841808-497c-4736-0057-a1d97440a28f e1855d5b-4faf-479d-00d1-d14a9e26a451 ~dhorwitz sakai.motd 1 Vula Announcements 0,0
1bc3185f-ebbd-4358-8078-b7dcf6bf17d9 e1855d5b-4faf-479d-00d1-d14a9e26a451 ~dhorwitz sakai.summary.calendar 2 Calendar 0,1
8d4bcd37-3f29-43fb-00ca-78970ecbee3f e1855d5b-4faf-479d-00d1-d14a9e26a451 ~dhorwitz sakai.rsf.accountinfo 3 UCT Account Information 1,1

3 rows in set (0.01 sec)

Comment by Zhen Qian [ 26-Jan-2009 ]

OK. I think the problem is you have a unique set of tools in your Home page, which is different from the typical set, and hence is not recognized.

Now the fix is to make the Home tool definition to be configurable...

  • Zhen
Comment by Stephen Marquard [ 26-Jan-2009 ]

How about setting a property on the Home page in the site? In My Workspaces, we don't want users to be able to remove Home at all (should be selected and greyed-out which I assume toolOrder.xml can do).

Comment by Zhen Qian [ 28-Jan-2009 ]

Fixed in r56935.

Now the tool set on home page can be configured using "wsetup.home.toolids". For example, institution can put the following in the sakai.properties file:


However, if the above param is not set, WSetup tool will use default, which is "sakai.iframe.site, sakai.summary.calendar, sakai.synoptic.announcement, sakai.synoptic.chat, sakai.synoptic.messagecenter" for worksites.
Among them, the synoptic tools will be added or dropped from Home page, depending on whether their linked tool exists in the site or not.


  • Zhen
Comment by Stephen Marquard [ 28-Jan-2009 ]

Hi Zhen,

I don't think this solution is general enough - we have more than one type of my workspace site, i.e. we have different templates for different account types, and the tools on the Home page differ.

The 'page property' option looks better to me, as this would get inherited from the template when a new my workspace site is created.

Comment by Zhen Qian [ 29-Jan-2009 ]


By "page property" option here, do you mean make the Home tool not removable? The default setting in toolOrder.xml only marks Home as selected but not require. Do you override this option in your installation? It can be handled all in toolOrder.xml, not in WSetup.

However, you've remind me I should really get the home tool id set from the template files based on site type, or user type if this is a workspace site.

Comment by Zhen Qian [ 03-Feb-2009 ]

With r57191, following sequence of looking for tool ids inside Home page is executed:

1. if Home tool is not added or removed, the list of tool ids are obtained from the current page. And if any tool, which is related to a synoptic tool inside the Home page, is removed, the corresponding synoptic tool will be removed too.

2. Otherwise, if Home tool is dropped and added back again, or if this is new site(not including MyWorkspace site, which is not created using Worksite Setup tool) and Home tool is added to the new site:

2.1 if this is a MyWorkspace site, look for template site with id !user.USER_TYPE first. If not found, look for !user site

2.2 else if this is a non-MyWorkspace site, look for template site with id !worksite.SITE_TYPE first, if not found, look for !worksite

2.3 if a template site is found, get tool ids from it.

2.4 if the tool id list is empty, use "wsetup.home.toolids" configuration variable from configure file, if defined.

2.5 if the tool id list is still empty, use OOTB system default:
for MyWorkspace site, "sakai.motd" or "sakai.iframe.myworkspace";
for other types of sites "sakai.iframe.site"
also adding various synoptic view tools, if applicable(corresponding tool is also in site): "sakai.summary.calendar", "sakai.synoptic.announcement", "sakai.synoptic.chat", "sakai.synoptic.messagecenter";

  • Zhen
Comment by Stephen Marquard [ 22-Feb-2009 ]

Zhen, there are some problems with this in cafe trunk, or any other build where there's a tool identified in Home in !worksite site, which isn't contained in the build.

To reproduce: run cafe trunk, try to create a new site.

The code needs to check whether the tool referenced in the !worksite template (or any other source e.g. sakai.properties value) is actually present, before trying to add it to a site.

Comment by Stephen Marquard [ 22-Feb-2009 ]

Also I think some of the WARN logging in SiteAction related to this could be dropped to debug - e.g. it would be normal not to have a !worksite.project site by default.

Comment by Peter Peterson (Inactive) [ 23-Feb-2009 ]

Zhen, could you comment the status of this issue? If possible we would like to have this available for the 2.6.0 release.

Comment by Zhen Qian [ 23-Feb-2009 ]

Fixes checked in as r57914 and r57915 according to Stephen's comment above.

For cafe build, unless specified in "wsetup.home.toolids" in sakai.properties, no tool could be found associated with Home page. So Home page will be created as an empty page.

However, if a page is empty, the page link won't be shown while user accesses the site. But this should be filed as an separate JIRA and is out of the ticket scope here.

For any production site with Home tool turned on as default tool, it should have at least one "Home page tool" defined and deployed...


  • Zhen
Comment by Nancy Wilkison (Inactive) [ 08-Apr-2009 ]

vista enterprise, firefox
server http://nightly2.sakaiproject.org:8087/portal

when editing My Workspace using edit tools,
verify user does not get unchecked Home page or two home pages.

Home page box is checked and only 1 Home page results from

I can still remove my Home page, if I wish.
I can also get it back but it ends up at the bottom of the left nav tools and
logging on will result in my being on the Profile page as default until
I re-order the tools and put Home back at the top.

Comment by Zhen Qian [ 08-Apr-2009 ]


If the Page Order has never been used for the site, worksite setup will enforce the default OOTB tool order based on the toolOrder.xml file, plus Home tool always on top of the list, and Site Info is always at the bottom.

However, once the user saves from Page Order, the above ordering sequence is no longer enforced. All newly added tool will be put to the bottom of the tool list. Of course, one can reorder them afterwards.

Comment by Nancy Wilkison (Inactive) [ 13-Apr-2009 ]

even if you only use Page Order to re-name something, NOT to change the order?
so simply using Page Order destroys the default order?

Comment by Nancy Wilkison (Inactive) [ 15-Apr-2009 ]

well...I guess the actual issue of two home pages has been corrected.


Comment by Stephen Marquard [ 11-May-2009 ]

On our 2-6-x production build, this breaks the ability to add new tools to course sites (though not project sites it seems, not sure why).

When you click on Finish from Site Info / Edit Tools, you get an error like this in the logs. Site Info / Organize Tools is unaffected.

2009-05-11 10:12:25,718 WARN TP-Processor406 org.sakaiproject.db.impl.BasicSqlService - Sql.dbWrite(): error code: 1048 sql: insert into SAKAI_SITE_TOOL (TOOL_ID, PAGE_ID, SITE_ID, REGISTRATION, PAGE_ORDER, TITLE, LAYOUT_HINTS) values (?,?,?,?,?,?,?) binds: b9544986-3905-4430-b5a9-dc5e2f3f0a89 789d8f2f-7448-4d2b-8c60-17bb8617aa21 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 null 5 null null
com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'REGISTRATION' cannot be null
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1011)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2046)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1964)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1949)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.sakaiproject.db.impl.BasicSqlService.dbWrite(BasicSqlService.java:1205)
at org.sakaiproject.db.impl.BasicSqlService.dbWrite(BasicSqlService.java:1039)
at org.sakaiproject.site.impl.DbSiteService$DbStorage.saveTx(DbSiteService.java:345)
at org.sakaiproject.site.impl.DbSiteService$DbStorage$1.run(DbSiteService.java:263)
at org.sakaiproject.db.impl.BasicSqlService.transact(BasicSqlService.java:328)
at org.sakaiproject.site.impl.DbSiteService$DbStorage.save(DbSiteService.java:259)
at org.sakaiproject.site.impl.BaseSiteService.doSave(BaseSiteService.java:880)
at org.sakaiproject.site.impl.BaseSiteService.save(BaseSiteService.java:807)
at org.sakaiproject.site.cover.SiteService.save(SiteService.java:165)
at org.sakaiproject.site.tool.SiteAction.commitSite(SiteAction.java:8783)
at org.sakaiproject.site.tool.SiteAction.saveFeatures(SiteAction.java:8486)
at org.sakaiproject.site.tool.SiteAction.doSave_revised_features(SiteAction.java:5864)

Comment by Anthony Whyte [ 11-May-2009 ]

Raising status to a blocker. David and I are reverting the fix out of the 2.6.x and 2.6.0 branches and I will cut an rc04 tag today.

Comment by David Horwitz [ 11-May-2009 ]

removed from 2-6-x and 2-6-0 with r62181

Comment by Zhen Qian [ 11-May-2009 ]

I cannot replicate the problem. I have tested on qa3-us, nightly trunk build with HSQL and nightly 2.6.x build, but all performed fine now.

Comment by Angela Joyce Henry (Inactive) [ 11-May-2009 ]

Sakai QA Network qa1-za (svn tags/sakai-2.6.0-rc03) using MySQL/InnoDB - Built: 05/11/09 12:08 - Sakai Revision: 62169 - Server localhost (Vista Ultimate, Firefox 3.x)

Could not replicate the problem. Home tool is checked but not greyed out. It can be unchecked and removed entirely from the list of tools. When it is re-checked, it becomes visible in the list of tools once more, as expected.

Comment by Zhen Qian [ 12-May-2009 ]

I will close this for now baed on Angela's observation.

Comment by Stephen Marquard [ 12-May-2009 ]

I don't see the point of closing this. The code is demonstrated to cause problems in at least one site. This should not get merged back into 2-6-x or a 2.6.0 release until it's fixed.

Comment by Zhen Qian [ 12-May-2009 ]


Could you please find out what tool triggered this message?

b9544986-3905-4430-b5a9-dc5e2f3f0a89 789d8f2f-7448-4d2b-8c60-17bb8617aa21 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623

Comment by Stephen Marquard [ 14-May-2009 ]

Looks like it was trying to add something into the Home page with a null tool reg:

mysql> select * from SAKAI_SITE_TOOL WHERE TOOL_ID='b9544986-3905-4430-b5a9-dc5e2f3f0a89';
Empty set (0.01 sec)

mysql> select * from SAKAI_SITE_PAGE WHERE PAGE_ID='789d8f2f-7448-4d2b-8c60-17bb8617aa21';



789d8f2f-7448-4d2b-8c60-17bb8617aa21 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Home 1 1 0

1 row in set (0.00 sec)

mysql> select * from SAKAI_SITE_PAGE WHERE SITE_ID='4b73f7c9-385d-42d1-87c8-8f1cd1bfe623';



044f90a2-2e05-4f99-a920-0d66af9dbe4d 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Search 0 6 0
14827f44-bed4-4d00-ae3c-c16759131d76 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Gradebook 0 8 0
222f6b13-26fe-4561-a31d-2d74f07d5f43 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Participants 0 4 0
33d7764f-74c7-4812-9a89-f3430b12684c 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Resources 0 5 0
598c93e2-5cd8-42a7-9cc5-ed579cc0e9f4 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Site Setup 0 11 0
789d8f2f-7448-4d2b-8c60-17bb8617aa21 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Home 1 1 0
8824d546-d222-433c-82f9-6f9e4fa076c9 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Forums 0 3 0
9c9dd6f7-c267-471f-99b4-b55c9516d101 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Announcements 0 2 0
b10eeaa1-5d79-4f54-a839-99c0cf055379 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Polls 0 10 0
f64907fe-671e-4634-92ac-5d91d27a1b4b 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Section Info 0 9 0
fc1f546c-916c-41b0-bc84-4468e5128330 4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 Course Outline 0 7 0

11 rows in set (0.00 sec)

mysql> select * from SAKAI_SITE WHERE SITE_ID='4b73f7c9-385d-42d1-87c8-8f1cd1bfe623';



4b73f7c9-385d-42d1-87c8-8f1cd1bfe623 BUS2020F,2009 course NULL NULL NULL NULL NULL 1 0 1 NULL 00f822b4-f351-491e-b925-035656f65618 00f822b4-f351-491e-b925-035656f65618 2009-02-10 14:36:32 2009-03-10 10:05:52 0 0 0

1 row in set (0.01 sec)

Comment by Zhen Qian [ 14-May-2009 ]


What is the usual tool set for the Home page there? Looks like the site has Announcements which would have synoptic view there. What is the Participants tool? And Course Outline?

Comment by Stephen Marquard [ 14-May-2009 ]

I found the problem. At some point we wanted to disable all the Messages & Forums synoptic tools on site home pages because of a temporary performance issue, so we ran:

update SAKAI_SITE_TOOL SET REGISTRATION='sakai.synoptic.messagecenter.site' where REGISTRATION='sakai.synoptic.messagecenter';

hence the Home page for the site had a tool in it with an invalid tool registration. Normally this is harmless because the portal doesn't render anything there for an unknown tool.

However, something in the changed SiteAction code led to that invalid tool registration being translated into a null registration when the Home page was saved when a new tool was added to the site.

So the immediate cause of this was inconsistent data in our db and the problem is this unreproduceable in OOTB builds.

However, the same situation could arise if synoptic tools were present in an installation, and the tool was later removed from the build, so it would be advisable to fix the underlying issue in SiteAction so that invalid tool reg. ids are not fatal.

Comment by Zhen Qian [ 14-May-2009 ]

Reopen according to Stephen's comment above

Comment by Zhen Qian [ 14-May-2009 ]

r62384 address the invalid tool id issue.

Comment by Peter Peterson (Inactive) [ 14-May-2009 ]

Is this issue fixed? If so please test and close, so we can get this into rc04 if possible.

Comment by David Horwitz [ 15-May-2009 ]

closed based on code review

Comment by Peter Peterson (Inactive) [ 28-Sep-2009 ]

In 2.6.0; removed 2.6.x as fix version in order to assure a clean 2.6.1 filter.

Generated at Fri Jul 19 05:57:08 CDT 2019 using Jira 7.13.5#713005-sha1:8d78f1047b9cca7d35d4d13f706b37e27d869e07.