File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public function addCommentsToTemplate(FrontendTemplate $objTemplate, \stdClass $
4242
4343 $ objTemplate ->comments = array (); // see #4064
4444
45- // Tag the comment (see #2137)
45+ // Tag the source record (see #2137)
4646 if (System::getContainer ()->has ('fos_http_cache.http.symfony_response_tagger ' ))
4747 {
4848 $ responseTagger = System::getContainer ()->get ('fos_http_cache.http.symfony_response_tagger ' );
@@ -100,6 +100,7 @@ public function addCommentsToTemplate(FrontendTemplate $objTemplate, \stdClass $
100100 if ($ objComments !== null && ($ total = $ objComments ->count ()) > 0 )
101101 {
102102 $ count = 0 ;
103+ $ tags = array ();
103104 $ objPartial = new FrontendTemplate ($ objConfig ->template ?: 'com_default ' );
104105
105106 while ($ objComments ->next ())
@@ -132,8 +133,17 @@ public function addCommentsToTemplate(FrontendTemplate $objTemplate, \stdClass $
132133 }
133134
134135 $ arrComments [] = $ objPartial ->parse ();
136+ $ tags [] = 'contao.db.tl_comments. ' . $ objComments ->id ;
137+
135138 ++$ count ;
136139 }
140+
141+ // Tag the comments (see #2137)
142+ if (System::getContainer ()->has ('fos_http_cache.http.symfony_response_tagger ' ))
143+ {
144+ $ responseTagger = System::getContainer ()->get ('fos_http_cache.http.symfony_response_tagger ' );
145+ $ responseTagger ->addTags ($ tags );
146+ }
137147 }
138148
139149 $ objTemplate ->comments = $ arrComments ;
You can’t perform that action at this time.
0 commit comments