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

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

norbe
Copy link
Contributor

@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
@dg
Copy link
Member

dg commented Jul 17, 2025

I have no idea why it doesn't reset, so hopefully this fix won't mess anything up.

@dg dg merged commit 05951f1 into nette:master Jul 17, 2025
dg pushed a commit that referenced this pull request Jul 17, 2025
dg pushed a commit that referenced this pull request Jul 17, 2025
dg pushed a commit that referenced this pull request Jul 17, 2025
dg pushed a commit that referenced this pull request Jul 17, 2025
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.

2 participants