Skip to content

A null value was found for the property named 'UniqueContentTypeOrder' #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AlexOxorn opened this issue Jul 25, 2019 · 2 comments
Open

Comments

@AlexOxorn
Copy link

AlexOxorn commented Jul 25, 2019

When I follow the instruction to create a new list from the readme, it is unable to save.
Here is the console's output

[83] pry(main)> list = Sharepoint::List.new site, { 'BaseTemplate' => Sharepoint::LIST_TEMPLATE_TYPE[:GenericList] } ; nil
=> nil
[84] pry(main)> list.title = 'My new list'
=> "My new list"
[85] pry(main)> list.description = 'A list created by sharepoint-ruby'
=> "A list created by sharepoint-ruby"
[86] pry(main)> list.save
Sharepoint::SPException: A null value was found for the property named 'DefaultContentApprovalWorkflowId', which has the expected type 'Edm.Guid[Nullable=False]'. The expected type 'Edm.Guid[Nullable=False]' does not allow null values.
from ~/.rvm/gems/ruby-2.3.0@[private]/gems/sharepoint-ruby-0.0.2/lib/sharepoint-ruby.rb:86:in `query'

The furthest I got was to do was to add "UniqueContentTypeOrder": { <SOMTHING> } to the hash, I have no idea what that SOMETHING is suppose to be.

Any insight on what I have to add to the deceleration of a new List ( or Folder, as the same thing happens with that )?

@AlexOxorn AlexOxorn reopened this Jul 25, 2019
@AlexOxorn
Copy link
Author

If it helps, this is the output of list.save with verbose on

[89] pry(main)> list.save
*   Trying 13.107.136.9...
* TCP_NODELAY set
* Connected to [private].sharepoint.com (13.107.136.9) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: C=US; ST=WA; L=Redmond; O=Microsoft Corporation; OU=Microsoft Corporation; CN=*.sharepoint.com
*  start date: Mar  7 21:35:03 2018 GMT
*  expire date: Mar  6 21:35:03 2020 GMT
*  subjectAltName: host "[private].sharepoint.com" matched cert's "*.sharepoint.com"
*  issuer: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; OU=Microsoft IT; CN=Microsoft IT TLS CA 1
*  SSL certificate verify ok.
> POST /_api/contextinfo HTTP/1.1
Host: [private].sharepoint.com
Cookie: FedAuth=[private]
Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose
Content-Length: 0

< HTTP/1.1 200 OK
< Cache-Control: private, max-age=0
< Transfer-Encoding: chunked
< Content-Type: application/json;odata=verbose;charset=utf-8
< Expires: Wed, 10 Jul 2019 18:02:05 GMT
< Last-Modified: Thu, 25 Jul 2019 18:02:05 GMT
< P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
< Set-Cookie: [private]; domain=sharepoint.com; path=/; secure; HttpOnly
< Set-Cookie: FedAuth=[private]; path=/; secure; HttpOnly
< X-SharePointHealthScore: 3
< X-SP-SERVERSTATE: ReadOnly=0
< DATASERVICEVERSION: 3.0
< SPClientServiceRequestDuration: 75
< X-AspNet-Version: 4.0.30319
< SPRequestGuid: [private]
< request-id: [private]
< MS-CV: [private]
< Strict-Transport-Security: max-age=31536000
< X-FRAME-OPTIONS: SAMEORIGIN
< X-Powered-By: ASP.NET
< MicrosoftSharePointTeamServices: 16.0.0.9117
< X-Content-Type-Options: nosniff
< X-MS-InvokeApp: 1; RequireReadOnly
< X-MSEdge-Ref: Ref A: [private] Ref B: [private] Ref C: 2019-07-25T18:02:05Z
< Date: Thu, 25 Jul 2019 18:02:04 GMT
< 
* Connection #0 to host [private].sharepoint.com left intact
*   Trying 13.107.136.9...
* TCP_NODELAY set
* Connected to [private].sharepoint.com (13.107.136.9) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: C=US; ST=WA; L=Redmond; O=Microsoft Corporation; OU=Microsoft Corporation; CN=*.sharepoint.com
*  start date: Mar  7 21:35:03 2018 GMT
*  expire date: Mar  6 21:35:03 2020 GMT
*  subjectAltName: host "[private].sharepoint.com" matched cert's "*.sharepoint.com"
*  issuer: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; OU=Microsoft IT; CN=Microsoft IT TLS CA 1
*  SSL certificate verify ok.
> POST //_api/web/lists HTTP/1.1
Host: [private].sharepoint.com
Cookie: FedAuth=[private]
Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose
X-RequestDigest: [private],25 Jul 2019 18:02:05 -0000
Content-Length: 702

* upload completely sent off: 702 out of 702 bytes
< HTTP/1.1 400 Bad Request
< Cache-Control: private, max-age=0
< Transfer-Encoding: chunked
< Content-Type: application/json;odata=verbose;charset=utf-8
< Expires: Wed, 10 Jul 2019 18:02:05 GMT
< Last-Modified: Thu, 25 Jul 2019 18:02:05 GMT
< P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
< Set-Cookie: [private]; domain=sharepoint.com; path=/; secure; HttpOnly
< Set-Cookie: FedAuth=[private]; path=/; secure; HttpOnly
< X-SharePointHealthScore: 2
< X-SP-SERVERSTATE: ReadOnly=0
< DATASERVICEVERSION: 3.0
< SPClientServiceRequestDuration: 21
< X-AspNet-Version: 4.0.30319
< SPRequestGuid: [private]
< request-id: [private]
< MS-CV: [private]
< X-RequestDigest: [private],25 Jul 2019 18:02:05 -0000
< Strict-Transport-Security: max-age=31536000
< X-FRAME-OPTIONS: SAMEORIGIN
< X-Powered-By: ASP.NET
< MicrosoftSharePointTeamServices: 16.0.0.9117
< X-Content-Type-Options: nosniff
< X-MS-InvokeApp: 1; RequireReadOnly
< X-MSEdge-Ref: Ref A: [private] Ref B: [private] Ref C: 2019-07-25T18:02:05Z
< Date: Thu, 25 Jul 2019 18:02:04 GMT
< 
* Connection #0 to host [private].sharepoint.com left intact
Sharepoint::SPException: A null value was found for the property named 'DefaultContentApprovalWorkflowId', which has the expected type 'Edm.Guid[Nullable=False]'. The expected type 'Edm.Guid[Nullable=False]' does not allow null values.

@Plaristote
Copy link
Owner

Hi, sorry for the late answer.
It sounds like the easiest way to fix that would be to set DefaultContentApprovalWorkflowId. I'm not sure how to set such a value. I don't have access to any sharepoint site right now.

If there are existing lists in your site, a quick workaround might be to do the following:

  existing_list = site.lists.first
  list.default_content_approval_workflow_id = existing_list.default_content_approval_workflow_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants