Fixing a rare case of bulk clearing of product properties
The last notes
Website hosting
If you are choosing hosting for your project, I recommend Reg.ru. Modern infrastructure, a wide range of plans from starter options to high-load VPS, and responsive tech support that actually helps instead of sending template replies. I host some of my own projects there and recommend it to my clients.
Go to site Affiliate link. The price remains the same for you.All English-language materials have been translated fully automatically using the Google service
Sudden Clearing of Product Properties in Bitrix: Incident Breakdown
The situation: a set of products (new ones each time) would, as if on a timer, lose almost all their properties once or twice an hour — SKUs, materials, sizes, names. Only the "blog post ID for comments" and gallery images survived. It looks like mass data corruption or someone else's script, but the cause is actually a stock feature that sat there for years silently corrupting data. Here's a brief breakdown.
Symptom
- Only two fields remain filled in a product: blog post ID for comments and gallery images. Everything else is empty.
- Affected products are new each time but always belong to specific completed orders, not the whole catalog.
- It fires like a timer: once or twice an hour, tied to customer activity.
- The issue appears on recent
Bitrixkernel versions paired with an oldAsprotemplate.
Cause
The culprit is the product rating component vote.products.lite from the Aspro template. Logic: a customer received an order, the site offers to rate the purchased items in the personal account. To remember which product was rated, the code writes the review number into the product card.
The bug is in how it does it. Instead of "add the review number to the properties," the code effectively tells the site "here is the full list of product properties — write it." And the list contains only the review number. The site obediently overwrites the properties and erases everything not in the list. Images survive because they're stored separately, in the gallery images field.
It triggers not via a specific request but as a side effect of a normal personal account page load. Every time a customer comes to rate products from a paid order, the component finds products without ratings, creates blog posts for them, and corrupts the properties.
Why access.log Didn't Help
The corruption looked like an ordinary GET /personal/ 200 — a routine customer visit to the personal account. No POST request to properties, no errors, no admin login in the log. The component logic ran inside PHP during page rendering, and in access.log it's indistinguishable from millions of other visits.
An indirect confirmation did surface: the customer's browser in that same second requested icons.svg icons specifically from the vote.products.lite template with a /personal/ referer. So the rating block did render, the component did fire, posts were created, and properties were wiped.
The working direction for investigation is not access.log but the database journals (which elements changed and when) and the Bitrix event log. Only there can you see what the code actually did inside the request.
What Was Done
The fix was to change the property write method. Instead of CIBlockElement::SetPropertyValues, which overwrites the element's entire set of properties, CIBlockElement::SetPropertyValuesEx is used — it updates only the passed properties and doesn't touch the rest.
Before:
\CIBlockElement::SetPropertyValues(
$arItem['ID'],
$arItem['IBLOCK_ID'],
[
\CIBlockPropertyTools::CODE_BLOG_POST => $postId,
]
);
After:
\CIBlockElement::SetPropertyValuesEx(
$arItem['ID'],
$arItem['IBLOCK_ID'],
[
\CIBlockPropertyTools::CODE_BLOG_POST => $postId,
]
);
Beyond the method fix:
- Fully disabled the rating feature — until the template is updated, it doesn't work.
- Restored affected products from a database backup.
- Set up a watcher: every five minutes it checks the cards and logs if anything similar happens again.
What to Check in Your Own Project
- The
Asprotemplate version in your project. If the template is old and theBitrixkernel is recent — the risk is the same. - Presence of the
vote.products.litecomponent and its settings in the customer's personal account. - Usage of
CIBlockElement::SetPropertyValuesin the project code and templates — this method overwrites properties entirely and easily wipes data if the array doesn't contain the full set. For targeted updates, useSetPropertyValuesEx. - The infoblock element change journal and the
Bitrixevent log — that's where traces of such "quiet" overwrites show up, ones that don't appear in access.log. - Whether your database backups are current. In this breakdown, it was the backup that restored the properties.
Comments