From szabgab at gmail.com Mon Sep 5 22:37:59 2011 From: szabgab at gmail.com (Gabor Szabo) Date: Tue, 6 Sep 2011 01:37:59 +0300 Subject: RSS feed of Buzilla news? Message-ID: Hi, I was looking at http://www.bugzilla.org/news/ and I was wondering if there is an RSS feed of Bugzilla related news? regards Gabor From aliustek at gmail.com Fri Sep 9 14:45:47 2011 From: aliustek at gmail.com (rojanu) Date: Fri, 9 Sep 2011 07:45:47 -0700 (PDT) Subject: Adding a column to an Object in an Extension Message-ID: Hi all, I have added a column to Bugzilla::Field::Choice in my extension, update works but creating a new value doesn't create the new column. When I added warn messages to code it seems that Bugzilla::Field::Choice::create runs before "object_before_create" hook. How can I make sure that group_id field is added to object?
sub install_update_db {
    my ($self, $args) = @_;

    my $dbh = Bugzilla->dbh;
    my @standard_fields =
        qw(bug_status resolution priority bug_severity op_sys
rep_platform);
    my $custom_fields = $dbh->selectcol_arrayref(
        'SELECT name FROM fielddefs WHERE custom = 1 AND type
IN(?,?)',
        undef, FIELD_TYPE_SINGLE_SELECT, FIELD_TYPE_MULTI_SELECT);
    foreach my $field_name (@standard_fields, @$custom_fields) {
    	if (!$dbh->bz_column_info($field_name, 'group_id')){
    	    my $field = new Bugzilla::Field({'name' => $field_name});
	        my $group = Bugzilla::Field::ChoiceGroup->create({
		        name   => "Default",
        		field => $field,
		        sortkey => "0",
		    });
        	$dbh->bz_add_column($field_name, 'group_id',
        												{TYPE => 'INT2'},
        												$group->id);
	        $dbh->bz_add_index($field_name, "${field_name}
_group_id_idx",
                           ['group_id']);
		}
    }
}

#############################
#                  Objects
#
#############################
sub object_columns {
    my ($self, $args) = @_;
    my ($class, $columns) = @$args{qw(class columns)};

    if ($class->isa('Bugzilla::Field::Choice')) {
        push(@$columns, 'group_id');
    }
}

sub object_before_create {
    my ($self, $args) = @_;
    my ($class, $params) = @$args{qw(class params)};
    if ($class->isa('Bugzilla::Field::Choice')) {
       warn "Creating CHOICE";
        my $input = Bugzilla->input_params;
        my $group_id = $input->{'group_id'};
        trick_taint($group_id);
        $params->{group_id}   = $group_id;
        warn "GID: ".$params->{group_id};
    }
}

sub object_validators {
    my ($self, $args) = @_;
    my ($class, $validators) = @$args{qw(class validators)};

    if ($class->isa('Bugzilla::Field::Choice')) {
        $validators->{group_id} = \&_check_group_id;
    }
}

sub object_end_of_create {
    my ($self, $args) = @_;

    my $class  = $args->{'class'};
    my $object = $args->{'object'};

	if ($class->isa('Bugzilla::Field')) {
		my $created_group = Bugzilla::Extension::FieldGroups::Group-
>create({
            name   => "Default",
            field => $class,
            sortkey => "0",
    	});
	}
}

sub object_update_columns {
    my ($self, $args) = @_;
    my ($object, $columns) = @$args{qw(object columns)};

    if ($object->isa('Bugzilla::Field::Choice')) {
        push(@$columns, 'group_id');
    }
}

sub object_end_of_set {
    my ($self, $args) = @_;

    my ($object, $field) = @$args{qw(object field)};

    if ($object->isa('Bugzilla::Field::Choice')) {
        my $input = Bugzilla->input_params;
        if ($object->{group_id} != $input->{'group_id'}) {
            my $group_id = $input->{'group_id'};
            trick_taint($group_id);
        	$object->{group_id} = $group_id;
        }
    }
}

sub object_end_of_set_all {
    my ($self, $args) = @_;
    my ($object) = $args->{object};
    warn "FINISHED SET ALL";
    if ($object->isa('Bugzilla::Field::Choice')) {
        my $input = Bugzilla->input_params;
        $object->set('group_id',   $input->{'group_id'});
    }
}
_______________________________________________ dev-apps-bugzilla mailing list dev-apps-bugzilla at lists.mozilla.org https://lists.mozilla.org/listinfo/dev-apps-bugzilla From mkanat at bugzilla.org Mon Sep 12 23:28:18 2011 From: mkanat at bugzilla.org (Max Kanat-Alexander) Date: Mon, 12 Sep 2011 16:28:18 -0700 Subject: RSS feed of Buzilla news? In-Reply-To: References: Message-ID: <4E6E9592.4010109@bugzilla.org> On 09/05/11 15:37, Gabor Szabo wrote: > I was looking at http://www.bugzilla.org/news/ and I was > wondering if there is an RSS feed of Bugzilla related news? Not exactly, but there is: http://planet.bugzilla.org/ -Max -- Max Kanat-Alexander Chief Architect, Community Lead, and Release Manager Bugzilla Project http://www.bugzilla.org/ From mkanat at bugzilla.org Mon Sep 12 23:37:21 2011 From: mkanat at bugzilla.org (Max Kanat-Alexander) Date: Mon, 12 Sep 2011 16:37:21 -0700 Subject: Adding a column to an Object in an Extension In-Reply-To: References: Message-ID: <4E6E97B1.9000208@bugzilla.org> > my $input = Bugzilla->input_params; > my $group_id = $input->{'group_id'}; > trick_taint($group_id); > $params->{group_id} = $group_id; FWIW, you should not be untainting group id here, you should be untainting it in a validator, if untainting is even required. > if ($object->isa('Bugzilla::Field::Choice')) { > my $input = Bugzilla->input_params; > if ($object->{group_id} != $input->{'group_id'}) { > my $group_id = $input->{'group_id'}; > trick_taint($group_id); > $object->{group_id} = $group_id; > } > } This code should not be in object_end_of_set. In fact, as far as I can see, you shouldn't have *any* code in object_end_of_set. This looks like code that belongs in a validator instead, and this isn't even a valid validation. I could pass in any number here and it would take it. Also, it looks like your object_validators hook references some function called _check_group_id, but I don't see that here. > sub object_end_of_set_all { It's possible that editvalues.cgi isn't using set_all, and that it should be. -Max -- Max Kanat-Alexander Chief Architect, Community Lead, and Release Manager Bugzilla Project http://www.bugzilla.org/ From aliustek at gmail.com Wed Sep 14 08:58:58 2011 From: aliustek at gmail.com (Robin Alan) Date: Wed, 14 Sep 2011 09:58:58 +0100 Subject: Adding a column to an Object in an Extension In-Reply-To: <4E6E97B1.9000208@bugzilla.org> References: <4E6E97B1.9000208@bugzilla.org> Message-ID: My mistake was that in _check_group_id an invalid check and returning undef. Also, I changed untaint to my $group = Bugzilla::Extension::FieldGroups::Group->new($input->{'group_id'}); to make sure the id passed is valid. Thanks From mkanat at bugzilla.org Wed Sep 14 20:00:19 2011 From: mkanat at bugzilla.org (Max Kanat-Alexander) Date: Wed, 14 Sep 2011 13:00:19 -0700 Subject: Adding a column to an Object in an Extension In-Reply-To: References: <4E6E97B1.9000208@bugzilla.org> Message-ID: <4E7107D3.9000000@bugzilla.org> On 09/14/2011 01:58 AM, Robin Alan wrote: > Also, I changed untaint to > > my $group = Bugzilla::Extension::FieldGroups::Group->new($input->{'group_id'}); > > to make sure the id passed is valid. Okay. However, validation should be done in the validator and nowhere else. -Max -- Max Kanat-Alexander Chief Architect, Community Lead, and Release Manager Bugzilla Project http://www.bugzilla.org/ From curaartritereumatoide at gmail.com Thu Sep 15 16:32:53 2011 From: curaartritereumatoide at gmail.com (Marco Marconi) Date: Thu, 15 Sep 2011 18:32:53 +0200 Subject: Un grande regalo per te!!!! Message-ID: Ciao sono Marco Marconi,ed ho preparato un grande regalo per te!!!! Attenzione, si tratta di un'occasione irripetibile, per favore non la ignorare! Voglio REGALARTI un ebook che ti permetter? di CURARE L'ARTRITE REUMATOIDE Un e-book nuovo, con informazioni importanti e mai viste prima sul web. Fai click sul link che trovi sotto, iscrivendoti riceverai il link per scaricare GRATIS il mio ebook. http://www.cura-artrite-reumatoide.com/squeeze.html Ti auguro una buona lettura ---------------------- Per ricevere GRATIS il mio ebook clicca qui sotto http://www.cura-artrite-reumatoide.com/squeeze.html Potrai cancellare la tua iscrizione o modificare i tuoi dati in ogni momento. Se ha ricevuto questa email per errore e non intendi iscriverti alla mia lista, non deve fare nient?altro. Non verr? iscritto a nessuna lista e non riceverai ulteriori informazioni fino a quando non confermerai la tua iscrizione. Marco Marconi -------------- next part -------------- An HTML attachment was scrubbed... URL: