Skip to content

SnippetRuntime: Fixed snippets rendering when multiple templates are rendered #349

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

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

Conversation

norbe
Copy link

@norbe norbe commented Jun 20, 2025

I have component (BasketControl) with multiple templates. At nette 2.4 I was able to redraw snippets at all templates, but it is not working after upgrade to current version.

Example code:

public function handleAddProduct() {
...
$this->presenter['basketControl']->redrawControl('basketMessages');
$this->presenter['basketControl']->snippetMode = true;
$this->presenter['basketControl']->renderMessage();
$this->presenter['basketControl']->redrawControl('small');
$this->presenter['basketControl']->snippetMode = true;
$this->presenter['basketControl']->renderSmall();
$this->presenter->sendPayload();
}
Before this patch it ends with error - Possible problem: you are sending a HTTP header while already having some data in output buffer.

Is there some reason why it is not unsetted after snippetRendering? I have used this quick fix, but I'm not sure about consequences...

@norbe norbe force-pushed the kh-snippet-runtime branch from c0aa29c to abe9a70 Compare June 20, 2025 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant