You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a new document type, there should be a way to handle other file extensions than .pdf when creating a new document for an order.
Actual behaviour
When creating a new document type, there is no way to specify another file extension than .pdf when creating a new document for an order.
How to reproduce
Create a new documet-type following the documentation.
Add a vue component named sw-order-document-settings-[my-new-document-type]-modal (extending sw-order-document-settings-modal) to handle creation of new documents (this should be added to the documentation)
There is no way to enrich the data passed to /api/_action/order/document/[my-new-document-type]/create with additional information like the fileType using the documentApiService.
Technically you could also use orderDocumentApiService to handle the creation of documents which would allow to add the fileType, however there is some handling of the response data in the documentApiService and adding a 2nd service and override the onCreateDocument of sw-order-document-settings-modal would kind of end up in messy code.
The DocumentGeneratorController also seems to validate the data passed to it and should invalidate any document where the fileType is not equal to pdf (->add('fileType', new Choice([FileTypes::PDF])) Line 53). However when validation, the validator tries to access the documents property of the passed documents (found here), but both services (documentApiService and orderDocumentApiService) pass their data as indexed array so the data will never actually be validated.
The DocumentGenerator is also just using a pdfResolver to resolve the rendered document returned by your custom-type renderer.
It seems like the system is built to support multiple file types, however it is not fully implemented yet. Are there any plans on when this happen?
Technically this is more like not yet implemented, than an actual bug.
The text was updated successfully, but these errors were encountered:
PHP Version
8.2
Shopware Version
6.6.1.2
Expected behaviour
When creating a new document type, there should be a way to handle other file extensions than
.pdf
when creating a new document for an order.Actual behaviour
When creating a new document type, there is no way to specify another file extension than
.pdf
when creating a new document for an order.How to reproduce
sw-order-document-settings-[my-new-document-type]-modal
(extendingsw-order-document-settings-modal
) to handle creation of new documents (this should be added to the documentation)/api/_action/order/document/[my-new-document-type]/create
with additional information like thefileType
using thedocumentApiService
.Technically you could also use
orderDocumentApiService
to handle the creation of documents which would allow to add thefileType
, however there is some handling of the response data in thedocumentApiService
and adding a 2nd service and override theonCreateDocument
ofsw-order-document-settings-modal
would kind of end up in messy code.The
DocumentGeneratorController
also seems to validate the data passed to it and should invalidate any document where thefileType
is not equal topdf
(->add('fileType', new Choice([FileTypes::PDF]))
Line 53). However when validation, the validator tries to access thedocuments
property of the passed documents (found here), but both services (documentApiService
andorderDocumentApiService
) pass their data as indexed array so the data will never actually be validated.The
DocumentGenerator
is also just using apdfResolver
to resolve the rendered document returned by your custom-type renderer.It seems like the system is built to support multiple file types, however it is not fully implemented yet. Are there any plans on when this happen?
Technically this is more like not yet implemented, than an actual bug.
The text was updated successfully, but these errors were encountered: