Merged 5.2.N (5.2.1) to HEAD (5.2)

132249 rmunteanu: REPO-1523: REGRESS: Site created from API cannot be accessed via Share


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@132361 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-11-03 20:06:29 +00:00
parent 15ca2477e0
commit edf2c25c42
3 changed files with 16 additions and 1 deletions

View File

@@ -1102,7 +1102,7 @@ public class SitesImpl implements Sites
SiteInfo siteInfo = null;
try
{
siteInfo = siteService.createSite(site.getPreset(), site.getId(), site.getTitle(), site.getDescription(), site.getVisibility());
siteInfo = siteService.createSite(site.getPreset() != null ? site.getPreset() : "sitePreset", site.getId(), site.getTitle(), site.getDescription(), site.getVisibility());
}
catch (SiteServiceException sse)
{

View File

@@ -150,6 +150,10 @@ public class SiteEntityResource implements EntityResourceAction.Read<Site>,
{
throw new InvalidArgumentException("Site update does not support field: role");
}
if (site.getPreset() != null)
{
throw new InvalidArgumentException("Site update does not support field: preset");
}
// Bind valid fields to a SiteUpdate instance.
final String title = site.getTitle();

View File

@@ -706,6 +706,17 @@ public class TestSites extends EnterpriseTestApi
null,
"Expected 400 response when updating "+site.getSiteId(), 400);
sitesProxy.update(
"sites",
site.getSiteId(),
null,
null,
"{\n" +
" \"preset\": \"sitePreset\"" +
"}",
null,
"Expected 400 response when updating "+site.getSiteId(), 400);
// Details should not have changed.
Site fresh = sitesProxy.getSite(site.getSiteId(), 200);
site.expected(fresh);