Cannot make changes to favorite spaces -- the UI for the change seems to work, but change doesn't persist
Asked by Larry Talley:

On the dashboard and also on spacedirectory I am able to click the star and it will change from gray to gold or from gold to gray... but, then when I revisit the dashboard or the spacedirectory, the setting will be back to original value. The changes I tried to make don't persist.

This isn't completely consistent. There is one space which was already a favorite, which consistently fails to become unfavorite. But there is another space which had not been a favorite, but which I can make into a favorite, and can also unfavorite.

Perhaps there is just the one space which won't allow me to change it's favorite state.

I will continue to explore, but, meanwhile I want to get this issue in your queue, as this issue has been confirmed for several users.


Answers:
author: Adam Laskowski
body: We have a [knowledge base article](http://confluence.atlassian.com/display/CONFKB/Cannot+Add+or+Remove+a+Favourite+Space+from+the+Dashboard) that outlines how to fix this if you are able to confirm that you have overlapping contentids and spaceids. If the queries provided may need tweaks depending on your specific DB in order to run, but if they hit any FK constraint errors, please open a support issue (<https://support.atlassian.com/>) and we can help.


author: Todd Patterson
body: Same problem here. We recently upgraded from Confluence 2.7.1 to 4.1 and now users cannot add or remove entries from their list of Favorite Spaces. Running the above MySql query against our Confluence 4.1 db returns 35 rows. I just opened a support ticket and referenced this question.

comments: author: Joe Clark
body: It might be worth mentioning CSP-55090 to the support engineer as the ticket with the solution. Just send me an email (jclark at atlassian dot com) if you have any problems with getting the right answer.


author: Larry Talley
body: As of today I am running Confluence 4.1. Before today I was on 4.0.3.

I have no custom stylesheets defined. I haven't tried disabling plugins... but the fact that it happens with specific spaces, and doesn't happen with most spaces, seems to me to make plugins unlikely.

So far I can only confirm the behavior with one space. It is a space that was created on Sept. 15, 2006. According to your downloads archive, that would mean it was created with version 2.2.9 or below.

I think I am probably experiencing the fringe case mentioned by Joseph. It is a fairly minor problem, but, if there is a way to confirm and fix I would like to know.

comments: author: Joe Clark
body: The fringe case we had to deal with in a support case recently was because the customer had a Confluence database that had been upgraded and upgraded from quite old versions of Confluence... the problem was that their database had Spaces with unique IDs that were identical to the IDs of pages in the database. In newer versions of Confluence, this cannot happen, and the code that does the favouriting/un-favouriting assumes that there will never be overlap of IDs between spaces and pages.

You should be able to tell if this is the problem affecting you by running a query on your Confluence database:

```
select SPACES.SPACEID, SPACES.SPACENAME from SPACES inner join CONTENT on CONTENT.CONTENTID = SPACES.SPACEID
```

If you get one or more rows returned from this query, then you've got the same problem, and you'll need to raise a support request with Atlassian to get the queries you need to run to fix up your data (If this is the case, mention to the support engineer that CSP-55090 is the ticket with the solution on it).


author: Joe Clark
body: Aha! :-) Definitely the same problem. The solution is to update your database so that all your Spaces have unique IDs that are higher than any of the IDs in the content table.

The queries can be a little bit tricky to run as you need to temporarily drop foreign key restraints before making the changes.

I'd strongly encourage you to raise a support ticket for this (<https://support.atlassian.com>) so that a support engineer can walk you through the process and ensure that the queries are going to work on your particular database and don't accidentally destroy anything.

If you send me the support issue key (ie. CSP-#####) I can add a note to the ticket that will direct the support engineer to the correct solution. You can post the issue key here, or if you'd prefer, email me (jclark at atlassian dot com).


author: Larry Talley
body: Thanks, we are on the right track now:

select count![](https://support.atlassian.com/images/icons/emoticons/star_yellow.gif) from content where contentid in (select spaceid from spaces);

returns 7

here are the spaces:  
select SPACES.SPACEID, SPACES.SPACENAME from SPACES inner join CONTENT on CONTENT.CONTENTID = SPACES.SPACEID;

SPACEID,SPACENAME  
1,Demonstration Space  
3,NMFS Alaska Region Data Stewardship  
7,Sustainable Fisheries  
8,Data Clerk Organization Discussion  
10,GOA Rockfish Pilot  
11,Larry Talley  
12,Restricted Access Management

and here are the pages:  
select C.TITLE from content c where contentid in (select spaceid from spaces);

TITLE  
Jira integration  
Using Spaces  
Source code  
Thumbnail gallery  
Home  
Sample content for thread demo  
Search Confluence content

I have tech support on the case. Thanks again for your help!


author: Joe Clark
body: What version of Confluence are you on? And also, what version of Confluence did you first use?

I ask because:

a) there is a bug fixed in Confluence 3.4 that fixes a similar problem: <https://jira.atlassian.com/browse/CONF-20633>

b) We recently had a support case that had similar symptoms, where the cause very old data in the Confluence database that had been upgraded and upgraded over time, where the original Confluence version was somewhere around the 2.0 timeframe.


author: Gregory Sudderth
body: What browser/version?

I have an outstanding but with the JS that makes the star work, where I can click it infinite times and it counts upward. I can see that it might have a bug in the "persist" direction too! The star bug I saw only happened on IE8.