Commit 8ffb200
committed
Avoid unnecessary database queries for non-existent report data
RT::Report::Entry inherits from RT::Record but lacks a backing database
table. Therefore, no need to query database for data that's not
pre-calculated.
For example, the _css_class attribute is only populated in some cases (when
rows are grouped by business hours or the involved custom date range sticks
to a static business hours spec). If this attribute is absent, calling
__Value('_css_class') would normally trigger an implicit database query. To
prevent this, here we unset PrimaryKeys to stop RT::Record from attempting
the invalid lookup.
This resolves SQL errors like:
couldn't execute the query 'SELECT _css_class FROM WHERE id = ?'1 parent 7a428be commit 8ffb200
3 files changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
1084 | | - | |
| 1084 | + | |
| 1085 | + | |
1085 | 1086 | | |
1086 | 1087 | | |
1087 | 1088 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
112 | 121 | | |
113 | 122 | | |
114 | 123 | | |
| |||
0 commit comments