Created attachment 407919 [details] [diff] [review] v1 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).
Created attachment 407928 [details] [diff] [review] v2 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.
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+
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
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.