Bug for CreateContentType

Jan 18, 2013 at 5:04 PM

Hi,

I had some problems with CreateContentType. It looks like both the CreateContentType and UpdateContentType are mapped twice with the same name, once for the list and once for the webs web service. Is this a bug or is it just me being tired? :-)

WSops.CreateContentType	= [LISTS, true];
WSops.CreateContentType	= [WEBS, true];

and 

// LISTS OPERATIONS
case "CreateContentType":
	addToPayload(opt, ["listName", "displayName", "parentType", "fields", "contentTypeProperties", "addToView"]);
	break;

// WEBS OPERATIONS
case "CreateContentType":
	addToPayload(opt, ["displayName", "parentType", "newFields", "contentTypeProperties"]);
	break;
/Fredrik

Coordinator
Jan 18, 2013 at 5:22 PM

Fredrik:

No, it's not you being tired. It looks like I started to fix it in v0.7.2, but didn't fully.

   // WEBS OPERATIONS
   case "Webs.CreateContentType":
    addToPayload(opt, ["displayName", "parentType", "newFields", "contentTypeProperties"]);
    break;

Most of the Web Services operations have unique names. In the cases where they don't, I've had to come up with something.

If you need a patch, I'd suggest this:

WSops.CreateContentType = [LISTS, true];
WSops.WebsCreateContentType = [WEBS, true];

// LISTS OPERATIONS
case "CreateContentType":
addToPayload(opt, ["listName", "displayName", "parentType", "fields", "contentTypeProperties", "addToView"]);
break;

// WEBS OPERATIONS
case "WebsCreateContentType":
addToPayload(opt, ["displayName", "parentType", "newFields", "contentTypeProperties"]);
break;

I can also make that change in my working version, so you'll be fine when I do the next release.

Let me know what you think.

M.

Jan 18, 2013 at 7:05 PM

Thanks a lot, that worked. Note that it was the same for UpdateContentType

/Fredrik