RH Topic Tags

"template outside configured directory" on phpBB 3.3 - RH Topic Tags

"template outside configured directory" on phpBB 3.3

by oleg.bash » Sun Mar 01, 2020 3:12 am

RH Topic Tags worked on my previous version of phpBB, but after I installed phpBB 3.3, RH started giving me problems. Everything works fine, except when I go to ACP and click on Whitelist or Blacklist, I get this:
Fatal error: Uncaught Twig\Error\LoaderError: Looks like you try to load a template outside configured directories (@robertheim_topictags/../../prosilver/theme/rh_topictags.css) in "@robertheim_topictags/css_includes.html" at line 16. in /home/mysite/public_html/phpBB/vendor/twig/twig/src/Loader/FilesystemLoader.php:291 Stack trace: #0 /home/mysite/public_html/phpBB/vendor/twig/twig/src/Loader/FilesystemLoader.php(209): Twig\Loader\FilesystemLoader->validateName('@robertheim_top...') #1 /home/mysite/public_html/phpBB/phpbb/template/twig/loader.php(135): Twig\Loader\FilesystemLoader->findTemplate('@robertheim_top...', true) #2 /home/mysite/public_html/phpBB/vendor/twig/twig/src/Loader/FilesystemLoader.php(150): phpbb\template\twig\loader->findTemplate('@robertheim_top...') #3 /home/mysite/public_html/phpBB/phpbb/template/twig/environment.php(328): Twig\Loader\FilesystemLoader->getCacheKey('@robertheim_top...') #4 /home/mysite/public_html/phpBB/cache/production/twig/d5/d580fee0d626eae3c6388240acf65baf372928794d4462b1b in /home/mysite/public_html/phpBB/vendor/twig/twig/src/Loader/FilesystemLoader.php on line 291
I tried going to "css_includes.html" and changing the "/.../" part to the absolute path as shown in the error message, but then instead of the Whitelist my ACP shows only a page with two buttons, Submit and Reset at the top, and nothing else.

The answer is probably some simple tweak that the experts wil know. Can anyone please help? I'm handy with CSS and HTML, but php is barely legible to me.
oleg.bash
Registered User
Posts: 16
Joined: Sat Sep 14, 2019 2:56 am

Re: "template outside configured directory" on phpBB 3.3

by pierredu » Sun Mar 01, 2020 7:54 am

Does the file exist in prosilver/theme ?
The extension works fine under 3.3.0 on my server.
User avatar
pierredu
Registered User
Posts: 1274
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: "template outside configured directory" on phpBB 3.3

by oleg.bash » Sun Mar 01, 2020 1:34 pm

The files are there, otherwise the error message would have said "file not found." I checked it many times. Everything else works, but without the whitelist I can't program the tags to show on the posting page.

My PHP version is 7.3.15 on a Linux server.

RH Tags are running just fine on the same server on the old phpBB 3.2.7, which I am trying to upgrade to 3.3. So I created a "sandbox" phpBB 3.3 board, to test-drive the new version. I have yet to figure out how to make it parse my old HTML posts, but that's another story.
oleg.bash
Registered User
Posts: 16
Joined: Sat Sep 14, 2019 2:56 am

Re: "template outside configured directory" on phpBB 3.3

by dimassamid » Sun Mar 15, 2020 2:02 pm

I have the same problem on 3.3 :(
dimassamid
Registered User
Posts: 61
Joined: Sat Aug 25, 2007 4:55 pm
Location: Tallinn, Estonia
Name: Dmitry

Re: "template outside configured directory" on phpBB 3.3

by dimassamid » Sun Mar 15, 2020 2:52 pm

I have fixed it as follows:

Open
ext/robertheim/topictags/styles/all/template/css_includes.html

Find and delete these lines

Code: Select all

<!-- IF S_RH_TOPICTAGS_INCLUDE_CSS_FROM_ACP -->
	<!-- INCLUDECSS @robertheim_topictags/../../prosilver/theme/rh_topictags.css -->
<!-- ENDIF -->
Clear cache

Now it's working!
dimassamid
Registered User
Posts: 61
Joined: Sat Aug 25, 2007 4:55 pm
Location: Tallinn, Estonia
Name: Dmitry

Re: "template outside configured directory" on phpBB 3.3

by oleg.bash » Sun Mar 15, 2020 3:18 pm

dimassamid - thank you very much! It worked!

I have no idea why or how, but removing the stylesheet made it perfect.

Now Robert Heim should amend his extension with your fix.

Have a great day and stay safe!
oleg.bash
Registered User
Posts: 16
Joined: Sat Sep 14, 2019 2:56 am

Re: "template outside configured directory" on phpBB 3.3

by thegioiluatsu » Thu Dec 31, 2020 10:08 am

I found the solution to this problem in a forum post: https://www.phpbb.com/customise/db/exte ... 26#p734426
Great because the problem is fixed. I think you might be in need.
I come from Vietnam and I love phpBB. Sorry guys because I don't know English. I have used google translate to be able to communicate with you guys at this forum. Here is my product: diễn đàn luật tự học luật
thegioiluatsu
Registered User
Posts: 48
Joined: Wed Dec 23, 2020 12:10 pm

Re: "template outside configured directory" on phpBB 3.3

by Lord Phobos » Thu Dec 01, 2022 4:23 am

Still having the problem on the tag cloud page.
Index and viewtopic works fine for now.
Lord Phobos
Registered User
Posts: 935
Joined: Tue May 18, 2004 11:41 pm

Re: "template outside configured directory" on phpBB 3.3

by dimassamid » Thu Dec 01, 2022 9:58 am

Fix for phpBB 3.3.9

Find files:
/ext/robertheim/topictags/styles/all/angular/angular.min.js
/ext/robertheim/topictags/styles/all/angular/ng-tags-input.2.1.1-1.workaroundissue278.min.js
/ext/robertheim/topictags/styles/all/angular/taginput.app.js


Move them to:
/ext/robertheim/topictags/styles/all/template/

Find file:
/ext/robertheim/topictags/styles/all/angular/ng-tags-input.min.css

Move it to:
/ext/robertheim/topictags/styles/all/theme/

Open:
/ext/robertheim/topictags/styles/all/template/js_includes.html

Find:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/../angular/angular.min.js -->
Replace with:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/angular.min.js -->
Find:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/../angular/ng-tags-input.2.1.1-1.workaroundissue278.min.js -->
Replace with:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/ng-tags-input.2.1.1-1.workaroundissue278.min.js -->
Find:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/../angular/taginput.app.js -->
Replace with:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/taginput.app.js -->
Open:
/ext/robertheim/topictags/styles/all/template/css_includes.html

Find:

Code: Select all

<!-- INCLUDECSS @robertheim_topictags/../angular/ng-tags-input.min.css -->
Replace with:

Code: Select all

<!-- INCLUDECSS @robertheim_topictags/ng-tags-input.min.css -->
Open:
/ext/robertheim/topictags/styles/prosilver/template/tags.html

Find:

Code: Select all

<!-- INCLUDECSS @robertheim_topictags/../theme/rh_topictags.css -->
Replace with:

Code: Select all

<!-- INCLUDECSS @robertheim_topictags/rh_topictags.css -->
dimassamid
Registered User
Posts: 61
Joined: Sat Aug 25, 2007 4:55 pm
Location: Tallinn, Estonia
Name: Dmitry

Re: "template outside configured directory" on phpBB 3.3

by Lord Phobos » Thu Dec 01, 2022 3:30 pm

Thanks!!!

But I still get this error in the in the index of my board (thus now unreachable):

Code: Select all

Fatal error: Uncaught Twig\Error\LoaderError: Looks like you try to load a template outside configured directories (../theme/rh_topictags.css) in "@robertheim_topictags/css_includes.html" at line 12. in /web/htdocs/www.lordphobos.com/home/castello2022/forum/vendor/twig/twig/src/Loader/FilesystemLoader.php:291 Stack trace: #0 /web/htdocs/www.lordphobos.com/home/castello2022/forum/vendor/twig/twig/src/Loader/FilesystemLoader.php(211): Twig\Loader\FilesystemLoader->validateName('../theme/rh_top...') #1 /web/htdocs/www.lordphobos.com/home/castello2022/forum/phpbb/template/twig/loader.php(135): Twig\Loader\FilesystemLoader->findTemplate('@robertheim_top...', true) #2 /web/htdocs/www.lordphobos.com/home/castello2022/forum/vendor/twig/twig/src/Loader/FilesystemLoader.php(150): phpbb\template\twig\loader->findTemplate('@robertheim_top...') #3 /web/htdocs/www.lordphobos.com/home/castello2022/forum/phpbb/template/twig/environment.php(328): Twig\Loader\FilesystemLoader->getCacheKey('@robertheim_top...') #4 /web/htdocs/www.lordphobos in /web/htdocs/www.lordphobos.com/home/castello2022/forum/vendor/twig/twig/src/Loader/FilesystemLoader.php on line 291

Maybe it comes from these lines:

Code: Select all

<!-- IF S_RH_TOPICTAGS_INCLUDE_CSS -->
	<!-- INCLUDECSS @robertheim_topictags/../theme/rh_topictags.css -->
<!-- ENDIF -->

<!-- IF S_RH_TOPICTAGS_INCLUDE_CSS_FROM_ACP -->
	<!-- INCLUDECSS @robertheim_topictags/../../prosilver/theme/rh_topictags.css -->
<!-- ENDIF -->
In /ext/robertheim/topictags/styles/all/template/css_includes.html?
Lord Phobos
Registered User
Posts: 935
Joined: Tue May 18, 2004 11:41 pm

Re: "template outside configured directory" on phpBB 3.3

by Lord Phobos » Thu Dec 01, 2022 3:35 pm

YEP:

solved converting to this:

Code: Select all

<!-- IF S_RH_TOPICTAGS_INCLUDE_CSS -->
	<!-- INCLUDECSS @robertheim_topictags/rh_topictags.css -->
<!-- ENDIF -->

<!-- IF S_RH_TOPICTAGS_INCLUDE_CSS_FROM_ACP -->
	<!-- INCLUDECSS @robertheim_topictags/rh_topictags.css -->
<!-- ENDIF -->
Lord Phobos
Registered User
Posts: 935
Joined: Tue May 18, 2004 11:41 pm

Re: "template outside configured directory" on phpBB 3.3

by dimassamid » Thu Dec 01, 2022 7:32 pm

I have version 3.0.0 installed from github. Those lines have already been fixed.
https://github.com/RobertHeim/phpbb-ext ... ludes.html
dimassamid
Registered User
Posts: 61
Joined: Sat Aug 25, 2007 4:55 pm
Location: Tallinn, Estonia
Name: Dmitry

Re: "template outside configured directory" on phpBB 3.3

by SANSI » Wed Dec 07, 2022 7:42 pm

dimassamid wrote:Fix for phpBB 3.3.9

Find files:
/ext/robertheim/topictags/styles/all/angular/angular.min.js
/ext/robertheim/topictags/styles/all/angular/ng-tags-input.2.1.1-1.workaroundissue278.min.js
/ext/robertheim/topictags/styles/all/angular/taginput.app.js


Move them to:
/ext/robertheim/topictags/styles/all/template/

Find file:
/ext/robertheim/topictags/styles/all/angular/ng-tags-input.min.css

Move it to:
/ext/robertheim/topictags/styles/all/theme/

Open:
/ext/robertheim/topictags/styles/all/template/js_includes.html

Find:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/../angular/angular.min.js -->
Replace with:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/angular.min.js -->
Find:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/../angular/ng-tags-input.2.1.1-1.workaroundissue278.min.js -->
Replace with:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/ng-tags-input.2.1.1-1.workaroundissue278.min.js -->
Find:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/../angular/taginput.app.js -->
Replace with:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/taginput.app.js -->
Open:
/ext/robertheim/topictags/styles/all/template/css_includes.html

Find:

Code: Select all

<!-- INCLUDECSS @robertheim_topictags/../angular/ng-tags-input.min.css -->
Replace with:

Code: Select all

<!-- INCLUDECSS @robertheim_topictags/ng-tags-input.min.css -->
Open:
/ext/robertheim/topictags/styles/prosilver/template/tags.html

Find:

Code: Select all

<!-- INCLUDECSS @robertheim_topictags/../theme/rh_topictags.css -->
Replace with:

Code: Select all

<!-- INCLUDECSS @robertheim_topictags/rh_topictags.css -->
I also had to modify the following:

Code: Select all

topictags/styles/all/template/event/posting_editor_subject_after.html
Replace line 7 with:

Code: Select all

<!-- INCLUDEJS @robertheim_topictags/whitelist.js -->
Find file:

Code: Select all

topictags/styles/all/whitelist.js
Copy to:

Code: Select all

topictags/styles/prosilver/template/whitelist.js
SANSI
Registered User
Posts: 32
Joined: Mon Apr 13, 2020 2:49 pm

Re: "template outside configured directory" on phpBB 3.3

by sanekplus » Sun Jan 01, 2023 8:13 pm

Fix for phpBB 3.3.9 for those who have shell access to the host:

shell:

Code: Select all

mv ext/robertheim/topictags/styles/all/angular/angular.min.js ext/robertheim/topictags/styles/all/angular/ng-tags-input.2.1.1-1.workaroundissue278.min.js ext/robertheim/topictags/styles/all/angular/taginput.app.js ext/robertheim/topictags/styles/all/template/
mkdir -p ext/robertheim/topictags/styles/all/theme
mv ext/robertheim/topictags/styles/all/angular/ng-tags-input.min.css ext/robertheim/topictags/styles/all/theme/
rmdir ext/robertheim/topictags/styles/all/angular
patch:

Code: Select all

--- ext/robertheim/topictags/styles/all/template/css_includes.html	2016-08-17 10:40:30.000000000 +0300
+++ ext/robertheim/topictags/styles/all/template/css_includes.html	2023-01-01 23:00:50.776126328 +0300
@@ -2,16 +2,16 @@
 	<!-- IF S_ALLOW_CDN -->
 		<!-- INCLUDECSS //cdnjs.cloudflare.com/ajax/libs/ng-tags-input/2.1.1-1/ng-tags-input.min.css -->
 	<!-- ELSE -->
-		<!-- INCLUDECSS @robertheim_topictags/../angular/ng-tags-input.min.css -->
+		<!-- INCLUDECSS @robertheim_topictags/ng-tags-input.min.css -->
 	<!-- ENDIF -->
 <!-- ENDIF -->
 
 <!-- IF 0 -->order matters, because we override some stuff<!-- ENDIF -->
 
 <!-- IF S_RH_TOPICTAGS_INCLUDE_CSS -->
-	<!-- INCLUDECSS @robertheim_topictags/../theme/rh_topictags.css -->
+	<!-- INCLUDECSS @robertheim_topictags/rh_topictags.css -->
 <!-- ENDIF -->
 
 <!-- IF S_RH_TOPICTAGS_INCLUDE_CSS_FROM_ACP -->
-	<!-- INCLUDECSS @robertheim_topictags/../../prosilver/theme/rh_topictags.css -->
+	<!-- INCLUDECSS @robertheim_topictags/rh_topictags.css -->
 <!-- ENDIF -->
--- ext/robertheim/topictags/styles/all/template/js_includes.html	2016-08-17 10:40:30.000000000 +0300
+++ ext/robertheim/topictags/styles/all/template/js_includes.html	2023-01-01 22:39:45.229643801 +0300
@@ -2,7 +2,7 @@
 	<!-- IF S_ALLOW_CDN -->
 		<!-- INCLUDEJS //ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.min.js -->
 	<!-- ELSE -->
-		<!-- INCLUDEJS @robertheim_topictags/../angular/angular.min.js -->
+		<!-- INCLUDEJS @robertheim_topictags/angular.min.js -->
 	<!-- ENDIF -->
 
 	<!-- IF 0 -->
@@ -12,7 +12,7 @@
 		When the PR is merged we should update the whole lib and provide CDN, e.g., for 2.1.1-1:
 		INCLUDEJS //cdnjs.cloudflare.com/ajax/libs/ng-tags-input/2.1.1-1/ng-tags-input.min.js
 	<!-- ENDIF -->
-	<!-- INCLUDEJS @robertheim_topictags/../angular/ng-tags-input.2.1.1-1.workaroundissue278.min.js -->
+	<!-- INCLUDEJS @robertheim_topictags/ng-tags-input.2.1.1-1.workaroundissue278.min.js -->
 
-	<!-- INCLUDEJS @robertheim_topictags/../angular/taginput.app.js -->
+	<!-- INCLUDEJS @robertheim_topictags/taginput.app.js -->
 <!-- ENDIF -->
--- ext/robertheim/topictags/styles/prosilver/template/tags.html	2016-08-17 10:40:30.000000000 +0300
+++ ext/robertheim/topictags/styles/prosilver/template/tags.html	2023-01-01 22:42:35.886517296 +0300
@@ -1,4 +1,4 @@
-<!-- INCLUDECSS @robertheim_topictags/../theme/rh_topictags.css -->
+<!-- INCLUDECSS @robertheim_topictags/rh_topictags.css -->
 <!-- INCLUDE overall_header.html -->
 
 <!-- INCLUDE tagcloud.html -->
sanekplus
Registered User
Posts: 6
Joined: Thu May 14, 2020 12:17 pm

Re: "template outside configured directory" on phpBB 3.3

by viper69 » Sat Jan 07, 2023 3:21 pm

Hi can anyone give fixed download link for 3.3.9?
viper69
Registered User
Posts: 234
Joined: Fri Jun 03, 2022 5:35 pm