TPAC: complex misc_util.tt2 parsing and logic should be moved into Perl module
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
New
|
Wishlist
|
Unassigned |
Bug Description
* Evergreen master
I'm opening this bug despite being very much a part of the progression of the TPAC from a relatively simple initial rollout to the much more complex state it has found itself in as of 2.7. At this point, wading into misc_util.tt2 requires some fearlessness; there's a ton of repetitive code and because of the difficulty in making Template::Toolkit code properly modular, it's pretty easy to overlook a dependency that some other chunk of code has. And one of the primary rationales for TT2 code is to be able to override template files with your own custom version. Doing that with misc_util.tt2 isn't really a good idea.
In short, most of the 600 lines of misc_util.tt2, and perhaps the core parts of record/authors.tt2 and record/
I agree the logic has become way too complex for a template.
We should also consider how bug #1251394 (metabib display fields) plays into this. Most of the "this field lives here in the MARC record" logic will move into the DB. Agreed the remaining logic should move into the Perl. I'd favor it living in a standalone module outside of EGCatLoader.