Closed acn-dgopa closed 1 year ago
All PDF content related features are now outside the scope of the PDF-generator. The PDF-generator will be built to generate PDF from HTML produced by the Apps.
Extremely important bug fixes might be considered. This issue is old and stale.
Description of the bug
We have a requirement in our app where we need to list values of an object added by a repeating group as code list in another page. F.ex, page 1 has repeating groups for adding persons. Page 2 has a dropdown that will list the persons in a dropdown. For this, we followed the documentation in altinn studio code lists
It works as expected in the app but when i send inn and try to generate pdf, it fails. If i exclude that dropdown from the pdf, it works.
Steps To Reproduce
Exception from pdf container logs `2022-06-13 09:35:27.627 ERROR 1 --- [nio-5070-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.util.NoSuchElementException: No value present] with root cause
java.util.NoSuchElementException: No value present at java.base/java.util.Optional.orElseThrow(Optional.java:377) ~[na:na] at altinn.platform.pdf.services.PDFGenerator.getDisplayValueFromOptions(PDFGenerator.java:541) ~[classes!/:1.0] at altinn.platform.pdf.services.PDFGenerator.renderLayoutElementContent(PDFGenerator.java:500) ~[classes!/:1.0] at altinn.platform.pdf.services.PDFGenerator.renderLayoutElement(PDFGenerator.java:382) ~[classes!/:1.0] at altinn.platform.pdf.services.PDFGenerator.renderRepeatingGroup(PDFGenerator.java:326) ~[classes!/:1.0] at altinn.platform.pdf.services.PDFGenerator.renderFormLayout(PDFGenerator.java:230) ~[classes!/:1.0] at altinn.platform.pdf.services.PDFGenerator.checkLayoutAndRenderPage(PDFGenerator.java:216) ~[classes!/:1.0] at altinn.platform.pdf.services.PDFGenerator.generatePDF(PDFGenerator.java:187) ~[classes!/:1.0] at altinn.platform.pdf.controllers.PDFController.generate(PDFController.java:27) ~[classes!/:1.0] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.20.jar!/:5.3.20] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.20.jar!/:5.3.20]`
Additional Information
No response