-
Notifications
You must be signed in to change notification settings - Fork 194
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
GetPagesAsync fails with pageHeader translateX or translateY as nulls #740
Comments
I am also facing exactly the same issue in my code. Please let us know about it when you have any findings. Thanks in advance! |
Thanks @jjtoscano and @cpercarb : seems like something changed in the backend, I'll have a look and will fix this. |
@jjtoscano / @cpercarb : I'm not able to simulate this. So you manually create a modern page and just save it as is and you get the error? |
@jjtoscano / @cpercarb : would be good if one of you can put a breakpoint on line 199 in PageHeader.cs and share the value of the |
hi @jansenbe, this is the content of the 'decoded' variable:
Sorry, I've been reviewing it and these are pages that have been created programmatically with the old OfficeDevPnP.Core.Pages library. If you review the generated JSON, internally these properties (translateX, translateY) are left marked null, which causes the issue when trying to retrieve a decimal from a null value using the GetPagesAsync method. |
Thanks for the details @jjtoscano : the snippet shows the |
@jjtoscano / @cpercarb : a fix has been committed. Please try again with tomorrow's nightly build and let me know if things work (or not). Thanks for bubbling up this issue. |
@jansenbe , I've been testing with the preview version "1.5.47-nightly" and it works fine with null values for the "translateX" and "translateY" properties. There is no trace of exceptions. Thank you very much for the quick response and fix! 💯 |
Awesome! Closing issue now |
Category
Describe the bug
When you retrieve a modern page whose header image has not been modified and has been left empty by default, a deserialization error occurs that leaves the following trace:
This deserialization error occurs because the page header internally has the translateX and translateY properties null.
Steps to reproduce
1. Create a modern page without modifying the header.2. Retrieve the modern page with the function GetPagesAsyncor
Expected behavior
The modern page should now be retrieved correctly when the translateX and translateY properties are null.
Environment details (development & target environment)
Additional context
The method FromHtml fails when it tries to get a decimal over a null type:
This happens on lines 281 and 303 of the PageHeader class.
Thanks for your contribution! Sharing is caring.
The text was updated successfully, but these errors were encountered: