Closed Bug 524007 Opened 15 years ago Closed 15 years ago

New Hook: object-end_of_create_validators

Categories

(Bugzilla :: Bugzilla-General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: mkanat, Assigned: mkanat)

Details

(Whiteboard: [es-ita])

Attachments

(1 file, 1 obsolete file)

Attached patch v1 (obsolete) — Splinter Review
We need a hook to be able to do things right after run_create_validators, to possibly modify the values that are going to be inserted into the database. This is a cheap way to modify the way that certain validators work (or how fields go into the database) without having to hook every single individual validator.

This patch may conflict with the other object- hooks that are awaiting review, but it should be easy to resolve the conflicts (they will just be in Bugzilla::Hook).
Attachment #407919 - Flags: review?(dkl)
Whiteboard: [es-ita]
Attached patch v2Splinter Review
Oops! I was accidentally passing the wrong variable to the hook.

Also, I discovered that this hook isn't *quite* as useful as I wanted it to be, because subclasses override run_create_validators and then they do validation *after* my hook runs.
Attachment #407919 - Attachment is obsolete: true
Attachment #407928 - Flags: review?(dkl)
Attachment #407919 - Flags: review?(dkl)
Comment on attachment 407928 [details] [diff] [review]
v2

*** ERROR: =over on line 598 without closing =back (at head2) at line 611 in file Bugzilla/Hook.pm
not ok 72 - Bugzilla/Hook.pm has incorrect POD syntax --ERROR
#   Failed test 'Bugzilla/Hook.pm has incorrect POD syntax --ERROR'
#   at t/011pod.t line 56.

Missing =back
Attachment #407928 - Flags: review?(dkl) → review-
Comment on attachment 407928 [details] [diff] [review]
v2

Actually you can fix the POD error that on checkin. I tested this and worked as expected. r=dkl
Attachment #407928 - Flags: review- → review+
Flags: approval?
Sweet, thanks! :-)
Flags: approval? → approval+
I did the POD fix on checkin.

Checking in Bugzilla/Hook.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Hook.pm,v  <--  Hook.pm
new revision: 1.35; previous revision: 1.34
done
Checking in Bugzilla/Object.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Object.pm,v  <--  Object.pm
new revision: 1.39; previous revision: 1.38
done
RCS file: /cvsroot/mozilla/webtools/bugzilla/extensions/example/code/object-end_of_create_validators.pl,v
done
Checking in extensions/example/code/object-end_of_create_validators.pl;
/cvsroot/mozilla/webtools/bugzilla/extensions/example/code/object-end_of_create_validators.pl,v  <--  object-end_of_create_validators.pl
initial revision: 1.1
done
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: