TPAC: complex misc_util.tt2 parsing and logic should be moved into Perl module

Bug #1407504 reported by Dan Scott
12
This bug affects 2 people
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/subjects.tt2, should be pulled back into the Perl modules--perhaps in OpenILS/WWW/EGCatLoader.pm and its children, or perhaps higher up so that the logic could be reused elsewhere. I suspect that would result in much less code that is easier to read, and it would facilitate access to database internals for the likes of config.metabib_field.

Tags: opac
Dan Scott (denials)
description: updated
description: updated
Revision history for this message
Bill Erickson (berick) wrote :

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.

Revision history for this message
Jason Boyer (jboyer) wrote :

It would still be nice to have some customization options re: fields and subfields without modifying the perl modules, because we are a location that uses a modified version of misc_util.tt2 and it's much nicer to just update our local templates dir rather than wait until there's a good time to rebuild the opac servers. I don't have a lot of suggestions about making that happen, but I would at least like to put the thought out there.

tags: added: opac
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.