Issue Bug New Orphaned

#101798Prevent saving unchanged inline records to save performance

Sebastian Michaelsen 08/30/23, 11:27 updated 07/31/24, 10:37

Description

Problem

When you have a record, which has 10 inline items and the record is translated (along with the inline items) into 10 languages, then saving the record even with no changes to the inline items causes the DataHandler to save 110 database records which can take some 30 seconds.

Why is that?

The inline records have toggles to hide/unhide them (unless the table does no support that), which means when saving the record there will be a `someid => [‘hidden’ => ‘0’]` entry for each inline item, which causes DataHandler to save that inline item, which then also triggers saving of its translations.

Solution(?)

It could be solved in backend JavaScript, so that the inline `hidden` form fields are only included in the request when their value was changed.

Workaround

For our project I created a backend middleware, that intercepts the `data` when a record is saved and removes any entries, that have just the hidden field and it is unchanged. (Yes, I create a database request for each of those entries but it’s still way faster than before)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] Prevent saving unchanged inline records to save performance Resolves: #101798 Releases: main