- Issue created by @drunken monkey
- Status changed to Needs review
about 2 years ago 10:24pm 2 March 2023 - 🇦🇹Austria drunken monkey Vienna, Austria
This would remove the forced item loads, without making this configurable.
Currently, _searchstax_add_tracking()
will call $item->getOriginalObject()
without $load = FALSE
, forcing an item load on pages that otherwise wouldn’t need them. We should probably avoid doing that.
The code in question needs the loaded item in order to track the document title (not really necessary), and to obtain the URL for the purpose of click tracking. The latter could, of course, be considered important enough to warrant loading the items, so maybe making this configurable would be the better option. (On the other hand, if the item has not been loaded at that point, its URL doesn’t seem to have been used in creating the displayed search results, so there’s a chance that click tracking will not work anyways, due to a mismatch in URLs.)
In any case, if we decide we want to load the items, if necessary, we should at least be smarter about it and load them as a single batch, not one at a time.
Needs review
1.0
Code
This would remove the forced item loads, without making this configurable.