File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
wcfsetup/install/files/lib/system/template Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 44
55use Laminas \Diactoros \Stream ;
66use Psr \Http \Message \StreamInterface ;
7+ use wcf \data \template \group \TemplateGroup ;
78use wcf \data \template \Template ;
89use wcf \system \cache \builder \TemplateGroupCacheBuilder ;
910use wcf \system \cache \builder \TemplateListenerCodeCacheBuilder ;
1011use wcf \system \event \EventHandler ;
1112use wcf \system \exception \SystemException ;
1213use wcf \system \Regex ;
1314use wcf \system \SingletonFactory ;
14- use wcf \system \WCF ;
1515use wcf \util \DirectoryUtil ;
1616use wcf \util \HeaderUtil ;
1717use wcf \util \StringUtil ;
@@ -1045,14 +1045,15 @@ protected function getCompileFilePrefix(string $templateName): string
10451045 private function getSharedTemplateGroupID (): int
10461046 {
10471047 if (!isset ($ this ->sharedTemplateGroupID )) {
1048- $ sql = " SELECT templateGroupID
1049- FROM wcf1_template_group
1050- WHERE templateGroupFolderName = ? " ;
1051- $ statement = WCF :: getDB ()-> prepare ( $ sql ) ;
1052- $ statement -> execute ([ ' _wcf_shared/ ' ]) ;
1053-
1054- $ this -> sharedTemplateGroupID = $ statement -> fetchSingleColumn ();
1048+ /** @var TemplateGroup $templateGroup */
1049+ foreach (TemplateGroupCacheBuilder:: getInstance ()-> getData () as $ templateGroup ) {
1050+ if ( $ templateGroup -> templateGroupFolderName === ' _wcf_shared/ ' ) {
1051+ $ this -> sharedTemplateGroupID = $ templateGroup -> templateGroupID ;
1052+ break ;
1053+ }
1054+ }
10551055 }
1056+
10561057 return $ this ->sharedTemplateGroupID ;
10571058 }
10581059}
You can’t perform that action at this time.
0 commit comments