Skip to content
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

Fix multi page rendering by setting global $INFO #435

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fschrempf
Copy link

@fschrempf fschrempf commented May 8, 2021

In case of rendering multiple pages into a single document, the context of the current page does not match the one of the pages
to be rendered. In some cases (e.g. with the struct plugin), the global $INFO is evaluated and as this is not set to match the page to be rendered, the struct plugin does not produce the expected output in the PDF.

Fix this by setting $INFO to match the current page to be rendered and restoring it afterwards.

In conjunction with cosmocode/dokuwiki-plugin-struct#574 this fixes the struct data output in multi-page PDFs.

In case of rendering multiple pages into a single document, the
context of the current page does not match the one of the pages
to be rendered. In some cases (e.g. with the struct plugin), the
global $INFO is evluated and as this is not set to match the page
to be rendered, the struct plugin does not produce the expected
output in the PDF.

Fix this by setting $INFO to match the current page to be rendered
and restoring it afterwards.

Signed-off-by: Frieder Schrempf <[email protected]>
@fschrempf
Copy link
Author

This also fixes the rendering of struct aggregations using variable filters as they also rely on $INFO being set to the correct page context. And there are probably other places where the rendering needs $INFO to be correct.

@Klap-in
Copy link
Collaborator

Klap-in commented Jan 25, 2022

This code is tested?

@Klap-in
Copy link
Collaborator

Klap-in commented Oct 8, 2022

I'm hesitating. Should the struct plugin not just use global $ID instead of $INFO['id']? Normally the $ID is updated before specific recursive rendering of pages, and $INFO['id'] is still on the background to know the original page?

Only the $INFO['id'] was used? or more properties of the $INFO array?

If use of $INFO the right way, then I'm fine merging this.

@splitbrain what do you think?

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.

2 participants