Fixing a rare case of bulk clearing of product properties
Rus
Eng
Исправляем редкий случай массовой очистки свойств товара
I solve complex technical challenges for Bitrix and 1C—ranging from auditing existing code to website development and configuring complex integrations—with a guarantee of results.
Recommended

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 Bitrix kernel versions paired with an old Aspro template.

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 Aspro template version in your project. If the template is old and the Bitrix kernel is recent — the risk is the same.
  • Presence of the vote.products.lite component and its settings in the customer's personal account.
  • Usage of CIBlockElement::SetPropertyValues in 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, use SetPropertyValuesEx.
  • The infoblock element change journal and the Bitrix event 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.
Aleksandr Tichiy
Author

Aleksandr Tichiy

Fullstack developer · 1C-Bitrix

I build and modernize online stores and corporate portals on 1C-Bitrix. Integrations with 1C, high-load performance, 152-FZ compliance. Writing about architecture and e-commerce.


Comments

There are no comments yet, you can be the first to leave it

Leave a comment

The site uses a comment pre-moderation system, so your message will be published only after approval by the moderator

You are replying to a user's comment

Send

FEEDBACK

Email me

Please message me to discuss the task. I work remotely and officially (as a self-employed professional); my hourly rate is 1,800 RUB, and I can dedicate 3–4 hours a day to the project. I respond quickly, and the consultation is free.

An error occurred while sending, please try again after a while
Message sent successfully

Phones

+7(993) 007-18-96

Email

info@tichiy.ru

Address

Россия, г. Москва

By submitting the form, you automatically confirm that you have read and accept the Privacy Policy site