GX-Bug #48659 » RebuildProductPropertiesIndexFix.patch
src/system/classes/properties/PropertiesDataAgent.inc.php (revision ) | ||
---|---|---|
21 | 21 |
{ |
22 | 22 |
$c_products_id = (int)$p_products_id; |
23 | 23 |
if(empty($c_products_id)) trigger_error('rebuild_properties_index: typeof($p_products_id) != integer', E_USER_ERROR); |
24 |
|
|
24 |
|
|
25 |
if($c_products_id != -1) $c_products_id = 'ppc.products_id = "'. $c_products_id .'" AND'; |
|
26 |
else $c_products_id =''; |
|
27 |
|
|
25 | 28 |
# remove old index content |
26 | 29 |
$t_sql = ' |
27 | 30 |
DELETE FROM products_properties_index |
... | ... | |
74 | 77 |
LEFT JOIN properties_description AS pd ON (pv.properties_id = pd.properties_id) |
75 | 78 |
LEFT JOIN properties_values_description AS pvd ON (pv.properties_values_id = pvd.properties_values_id) |
76 | 79 |
WHERE |
77 |
ppc.products_id = "'. $c_products_id .'" AND
|
|
80 |
'.$c_products_id.'
|
|
78 | 81 |
pd.language_id = "'. $c_language_id .'" AND |
79 | 82 |
pvd.language_id = "'. $c_language_id .'" |
80 | 83 |
'; |
src/system/core/caching/CacheControl.inc.php (revision ) | ||
---|---|---|
272 | 272 |
$t_sql = 'TRUNCATE products_properties_index'; |
273 | 273 |
xtc_db_query($t_sql); |
274 | 274 |
|
275 |
$t_sql = ' |
|
276 |
SELECT products_id |
|
277 |
FROM products_properties_combis |
|
278 |
GROUP BY products_id |
|
279 |
'; |
|
280 |
$t_result = xtc_db_query($t_sql); |
|
281 |
|
|
282 |
while(($t_row = xtc_db_fetch_array($t_result) )) |
|
283 |
{ |
|
284 |
$coo_properties_data_agent->rebuild_properties_index($t_row['products_id']); |
|
285 |
} |
|
275 |
$coo_properties_data_agent->rebuild_properties_index(-1); |
|
286 | 276 |
} |
287 | 277 |
} |
288 | 278 |
|