-
Notifications
You must be signed in to change notification settings - Fork 121
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
templates: better support cross-format templates #4463
base: main
Are you sure you want to change the base?
templates: better support cross-format templates #4463
Conversation
lib/Service/TemplateFieldService.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part I understand and think is nice, we can skip writing to a temp file altogether since the transform document structure endpoint already can convert the document, it seems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff I don't really get, when I tried running it and creating a new file it doesn't quite work properly since the template service fillFields
method expects a file to be handed to it; with these changes there isn't one. Can you explain a bit more the reasoning behind this or why it would be necessary? I don't completely understand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I shouldn't have moved the empty template code path, thanks.
24a0b2e
to
6f42253
Compare
if ($this->capabilitiesService->hasFormFilling()) { | ||
try { | ||
$filledTemplate = $this->templateFieldService->fillFields($templateFile, $event->getTemplateFields()); | ||
$filledTemplate = $this->templateFieldService->fillFields($templateFile, $event->getTemplateFields(), null, event->getTarget()->getExtension()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a $
$filledTemplate = $this->templateFieldService->fillFields($templateFile, $event->getTemplateFields(), null, event->getTarget()->getExtension()); | |
$filledTemplate = $this->templateFieldService->fillFields($templateFile, $event->getTemplateFields(), null, $event->getTarget()->getExtension()); |
If form filling was used to create a file, do not add a template source. Otherwise Collabora Online creates the file again from the template. Use the format option in 'transform-document-structure' to avoid an intermediate save in the template format, which might not be supported as a save format. Signed-off-by: Jaume Pujantell <[email protected]>
6f42253
to
b6879ef
Compare
If form filling was used to create a file, do not add a template source. Otherwise Collabora Online creates the file again from the template.
Use the format option in 'transform-document-structure' to avoid an intermediate save in the template format, which might not be supported as a save format.