Not a bug last_modified_cache is used even when we have LastModifiedUser relation

TickTackk

Well-known member
Affected version
2.0.x
In template: report_list_macros
Find:
PHP:
<xf:username user="{$report.last_modified_cache}" />
Replace with:
PHP:
<xf:username user="{$report.LastModifiedUser}" defaultname="{$report.last_modified_username}" />
 
This doesn't cause a query, but touching the ->User relationship does anyway. Might as well load both the User and
LastModifiedUser relationships when loading reports for a list.
 
This isn't an uncommon pattern and you'll see it in things like threads as well. We don't always directly require a relationship and use denormalized data instead.
 
Back
Top Bottom