tech15
(Digital Team)
October 18, 2021, 7:35pm
1
If you create a Release without a description, which is possible by Publishing a document and choosing "Publish at a specific date and time", the ref returned by Prismic's API will have a null label and the Prismic client will fail to parse the entire response.
We found this in version 1.7.0, but still appears to be an issue on master. This line will fail with a "NoMethodError: undefined method `downcase' for nil:NilClass" ruby-kit/api.rb at 1.7.0 · prismicio-community/ruby-kit · GitHub
This brought down our site while we diagnosed the issue as the Prismic Ruby client failed to give us a response. It seems like Prismic API should return something other than null here, modify the client to accept a null label, or not allow a release without a description.
Fares
October 19, 2021, 10:14am
3
Hi there,
Thanks for reporting this issue.
I have investigated this issue, and I see the problem, and I believe the fix should be done in the Kit itself.
For that, Can you create an issue in the project tracker , with the details that you have added here and I, will try to push forward?
I don't know Ruby, but basically, I think the fix would be something like this ref['label'].nil ? nil : ref['label']. downcase
Please let me know if you need any further help,
Fares
Fares
November 2, 2021, 5:05pm
4
I have created an issue on the Kit
opened 05:04PM - 02 Nov 21 UTC
bug
<!-- 💙 Thanks for your time to make this package better with your feedback 💙
… **IMPORTANT** Before reporting a bug please make sure that you have read through the documentation:
- https://prismic.io/docs
👍 A properly detailed bug report can save a LOT of time and help fixing issues as soon as possible.
-->
If you create a Release without a description, which is possible by Publishing a document and choosing "Publish at a specific date and time", the ref returned by Prismic's API will have a null label and the Prismic client will fail to parse the entire response.
https://github.com/prismicio-community/ruby-kit/blob/1.7.0/lib/prismic/api.rb#L222
Found this in version 1.7.0, but still appears to be an issue on master. This line will fail with a "NoMethodError: undefined method `downcase' for nil:NilClass" ruby-kit/api.rb at 1.7.0 · prismicio-community/ruby-kit · GitHub 1
### Versions
- ruby-kit:
- gem version:
### Reproduction
<details open>
<summary>Additional Details</summary>
https://community.prismic.io/t/release-without-description-causes-error-in-prismic-ruby-client/7514
<br>
</details>
### Steps to reproduce
### What is Expected?
### What is actually happening?
Please feel free to add any extra details if necessary.