ext.php
file.Thank you!martti wrote: Tue Mar 27, 2018 5:01 am Probably it's cache related. I will see if something can be done in theext.php
file.
as per title
for extension developers
Yeah I know... but it's a fast way to locate events I only enable it when I need it
It works even faster when you have it permanently enabled on a test board - no on/off-switching needed
Oke you have a point therecanonknipser wrote: Wed Mar 28, 2018 7:56 pmIt works even faster when you have it permanently enabled on a test board - no on/off-switching needed
This was until shortly the behaviour of the extension, but as @canonknipser remarked, this extension is to be used in development only, so I removed this behaviour because then you can also see the events when logged out or from users with other permissions.Froddelaar wrote: Wed Mar 28, 2018 7:42 pm Also noticed that the "show" is also viewable and working by guests and members.
Is it possible to show this only for admins or founder ?
Are you referring to the bug-screen I have earlier posted?martti wrote: Thu Mar 29, 2018 10:25 am @Froddelaar and others who get a blank page upon enabling the extension: Do you have the "Recompile stale style components" option enabled?
ACP > General > Server Configuration > Load Settings > Recompile stale style components
When I turn off this option, I also get a blank page. But when developing extensions this option should be turned on.
edited: "Server Settings" became "Server Configuration"
topiclist_row_topic_title_after
, topiclist_row_append
and topiclist_row_prepend
all appear in search_results.html
, viewforum_body.html
and mcp_forum.html
. The link will carry you to the event that was actually triggered. I.e on the viewforum
page, the link will point to the event in viewforum_body.html
, on the search
page, the link of the same event will point to the line where the event appears in search_results.html
Code: Select all
PHP Fatal error: Uncaught Twig_Error_Syntax: Unknown "marttiphpbb_templateevents_render" function. in /home/martti/pjt/phpbb/x/ext/marttiphpbb/templateevents/styles/all/template/event/overall_header_feeds.html:1
Stack trace:
#0 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/ExpressionParser.php(374): Twig_ExpressionParser->getFunctionNodeClass('marttiphpbb_tem...', 1)
#1 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/ExpressionParser.php(162): Twig_ExpressionParser->getFunctionNode('marttiphpbb_tem...', 1)
#2 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/ExpressionParser.php(102): Twig_ExpressionParser->parsePrimaryExpression()
#3 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/ExpressionParser.php(55): Twig_ExpressionParser->getPrimary()
#4 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/Parser.php(147): Twig_ExpressionParser->parseExpression()
#5 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/Parser.php(103): Twig_Parser->subparse(NULL, false)
#6 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/Envi in /home/martti/pjt/phpbb/x/ext/marttiphpbb/templateevents/styles/all/template/event/overall_header_feeds.html on line 1
I am following the development's progresses here, congrats about the new features.martti wrote: Sun Apr 01, 2018 9:27 pm Hmm, when I enable another extension suddenly the Twig Function which was defined in this extension is not recognised anymore. I don't understand why, but it start to look like that phpBB extensions cannot define Twig Extensions in a stable way.
Code: Select all
PHP Fatal error: Uncaught Twig_Error_Syntax: Unknown "marttiphpbb_templateevents_render" function. in /home/martti/pjt/phpbb/x/ext/marttiphpbb/templateevents/styles/all/template/event/overall_header_feeds.html:1 Stack trace: #0 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/ExpressionParser.php(374): Twig_ExpressionParser->getFunctionNodeClass('marttiphpbb_tem...', 1) #1 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/ExpressionParser.php(162): Twig_ExpressionParser->getFunctionNode('marttiphpbb_tem...', 1) #2 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/ExpressionParser.php(102): Twig_ExpressionParser->parsePrimaryExpression() #3 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/ExpressionParser.php(55): Twig_ExpressionParser->getPrimary() #4 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/Parser.php(147): Twig_ExpressionParser->parseExpression() #5 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/Parser.php(103): Twig_Parser->subparse(NULL, false) #6 /home/martti/pjt/phpbb/x/vendor/twig/twig/lib/Twig/Envi in /home/martti/pjt/phpbb/x/ext/marttiphpbb/templateevents/styles/all/template/event/overall_header_feeds.html on line 1
$twig = $this->container->get('template.twig.environment');
that service doesn't exists there (see below)template.twig.environment'
s etc. $user->add_lang_ext('marttiphpbb/templateevents', 'common');
$twig = new \Twig_Environment();
Code: Select all
$twig = new \Twig_Environment();
$request = $this->container->get('request');
$user = $this->container->get('user');
$user->add_lang_ext('marttiphpbb/templateevents', 'common');
$cache = $this->container->get('cache.driver');
$php_event_listener = new php_event_listener();
$events_cache = new events_cache($cache);
$twig_extension = new extension($request, $user, $php_event_listener, $events_cache);
$twig->addExtension($twig_extension);
return 'add_twig_extension';
break;
interface Twig_ExtensionInterface
as the first element in the constructor, and create an abstract class for it, else can not be instantiated).