Problem
VisitTracker::trackVisit() builds its insert fields inline, making it impossible for submodules to add extra columns (e.g. domain_id) without duplicating the entire insert logic.
The ShortUrlVisitMiddleware already has a buildVisitFields() method that subclasses can override, but the VisitTracker service does not.
Proposed solution
Extract the field-building logic into a protected buildVisitFields(Redirect $redirect, Request $request) method, matching the pattern already used in the middleware. This allows submodules like domain_shorturl to extend VisitTracker and add extra columns transparently with a single INSERT query.
Issue fork shorturl-3584473
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mably commentedComment #4
mably commentedComment #6
mably commented