Skip to content

Introduce missing first and htmlToPdf methods to PdfexportHook#5491

Merged
lippserd merged 3 commits into
mainfrom
pdf-hook
Jun 25, 2026
Merged

Introduce missing first and htmlToPdf methods to PdfexportHook#5491
lippserd merged 3 commits into
mainfrom
pdf-hook

Conversation

@TheSyscall

@TheSyscall TheSyscall commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

This PR adds two methods to the pdfexport hook: first and htmlToPdf

Both functions were previously called without actually being part of the hook.
The only possible implementation of this hook comes from the pdfexport module which already defines the same two methods.

Intentionally leaving out strict types and HookEssentials to be backward compatible with the original hook implementation.

@TheSyscall TheSyscall requested a review from Al2Klimov April 8, 2026 08:51
@cla-bot cla-bot Bot added the cla/signed label Apr 8, 2026
@TheSyscall TheSyscall self-assigned this Apr 8, 2026
TheSyscall added a commit to Icinga/icingaweb2-module-pdfexport that referenced this pull request Apr 8, 2026
@TheSyscall TheSyscall changed the title Introduce htmlToPdf method Introduce PdfexportHook::htmlToPdf method Apr 8, 2026
Al2Klimov

This comment was marked as resolved.

Comment thread library/Icinga/Application/Hook/PdfexportHook.php Outdated
@TheSyscall TheSyscall changed the title Introduce PdfexportHook::htmlToPdf method Introduce missing first and htmlToPdf methods to PdfexportHook May 20, 2026
@TheSyscall TheSyscall requested a review from Al2Klimov May 20, 2026 11:12
Comment thread library/Icinga/Common/PdfExport.php Outdated
Comment thread library/Icinga/Application/Hook/PdfexportHook.php
Comment thread library/Icinga/Application/Hook/PdfexportHook.php Outdated
Comment thread library/Icinga/Application/Hook/PdfexportHook.php Outdated
Comment thread library/Icinga/Application/Hook/PdfexportHook.php Outdated
@TheSyscall TheSyscall requested a review from Al2Klimov May 21, 2026 12:57
Comment thread library/Icinga/Application/Hook/PdfexportHook.php Outdated
Al2Klimov
Al2Klimov previously approved these changes May 22, 2026

@lippserd lippserd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase if needed and fixup your commits. It makes sense to mention in the commit message(s) that strict types have been left out on purpose to be compatible with the already existing implementation.

It made little sense that we ask a concrete hook implementation for the
first implementation of a hook. It essentially limited us to exactly one
possible pdfexport extension (our own), which is not how hooks are
supposed to work.

Strict types have been left out intentionally to stay compatible with
the existing imeplementation.
This method was always required because it was called by the reporting
module assuming that our own implementation of the pdfexport module was
the one chosen.

Because this behavior exists and our pdfexport module is the only
implementation of this hook this is not a breaking change.

Strict types have been left out on purpose to be compatible with the
already existing implementation.
This commit also includes phpdoc formating changes.

Strict types have been left out on purpose to be compatible with the
already existing implementation.
@TheSyscall

Copy link
Copy Markdown
Contributor Author

Reverted implementation of HookEssentials as it breaks backward compatibility with the original implementation.

@lippserd lippserd merged commit b759046 into main Jun 25, 2026
13 checks passed
@lippserd lippserd deleted the pdf-hook branch June 25, 2026 07:25
@lippserd lippserd added this to the 2.14.0 milestone Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants