]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
(no bug) Backout PR #60 - new feature not valid for stable branch (#164)
authorDave Miller <justdave@bugzilla.org>
Sun, 28 Apr 2024 04:31:36 +0000 (00:31 -0400)
committerGitHub <noreply@github.com>
Sun, 28 Apr 2024 04:31:36 +0000 (00:31 -0400)
This was accidentally included in the 5.0.4 branch, which should have branched just before this commit. Everything else after it before we did end up branching would have been cherry-picked anyway.

Bugzilla/Hook.pm
Bugzilla/Template.pm
extensions/Example/Extension.pm

index d8ae674636d448a9b17b35529f2bdfed4cdf3408..d6ba5e1d0e471284489d7b0ca0eac592f0987af9 100644 (file)
@@ -1479,21 +1479,6 @@ look at the code for C<create> in L<Bugzilla::Template>.)
 
 =back
 
-=head2 template_after_create
-
-This hook allows you to manipulate the Template object before it is used.
-You can use this to define new vmethods or filters in extensions.
-
-Params:
-
-=over
-
-=item C<template>
-
-This is the L<Bugzilla::Template> object.
-
-=back
-
 =head2 template_before_process
 
 This hook is called any time Bugzilla processes a template file, including
index 7294e27c195e650bc2596cbf4f591627f2fa187e..decffe1e8d5eb4eaeb686f007140b2b048d80f35 100644 (file)
@@ -1186,7 +1186,6 @@ sub create {
     Bugzilla::Hook::process('template_before_create', { config => $config });
     my $template = $class->new($config) 
         || die("Template creation failed: " . $class->error());
-    Bugzilla::Hook::process('template_after_create', { template => $template });
 
     # Pass on our current language to any template hooks or inner templates
     # called by this Template object.
index c4fabe656b3620c7356c61e6e1c21e04cf54e257..dbc84df7211ce78ac402d3796afb71e6748065f1 100644 (file)
@@ -920,19 +920,6 @@ sub template_before_create {
     $config->{VARIABLES}->{example_global_variable} = sub { return 'value' };
 }
 
-sub template_after_create {
-    my ( $self, $args ) = @_;
-    my $context = $args->{template}->context;
-
-    # define a pluck method on template toolkit lists.
-    $context->define_vmethod(
-        list => pluck => sub {
-            my ( $list, $field ) = @_;
-            return [ map { $_->$field } @$list ];
-        }
-    );
-}
-
 sub template_before_process {
     my ($self, $args) = @_;