You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all I'm not sure if this is really considered a bug or working as intended.
I'm using tl_content as an example but in general all tables with pid and sorting are affected.
When moving content elements from one place to another Contao may update the sorting value of surrounding elements which where not explicitly moved. As an example lets say we have an article with 5 content elements in it:
id
sorting
tstamp
type
1
64
1000000000
headline
2
128
1000000000
text
3
129
1000000000
html
4
130
1000000000
image
5
131
1000000000
text
Now I want to move the elements with ID 4 and 5 between 2 and 3. To do this I select ID 4 and 5, click "Cut" and then "Paste after" ID 2. This results in the following data:
id
sorting
tstamp
type
1
64
1000000000
headline
2
128
1000000000
text
3
134
1000000000
html
4
129
1234567890
image
5
130
1234567890
text
ID 4 and 5 have updated sorting values to represent their new position and updated tstamps as I explicitly moved them. ID 3 also has an updated sorting value as it had to move down to make place for ID 4 and 5., BUT ID 3 does NOT have an updated tstamp as it was not moved explicitly.
Depending on the definition you could either say that ID 3 should have a new tstamp, as it has technically changed, but you could also say it should not have a new tstamp as it was not changed by a user.
The reason I even bring this topic up is the following: we have custom code in place to keep two Contao systems in sync. That means if something changes in system 1 it should also get updated in system 2. The tstamp is used to detect and sync any changes, otherwise we would always need to check all database entries for changes, as usually the tstamp gets updated if something changes. Except in this specific case.
I'm really not sure if that is an issue for anyone except me and if it should be changed or not. If it will be changed, as far as I know the following 3 statements in DC_Table would need to also update the tstamp:
Affected version(s)
All versions
Description
First of all I'm not sure if this is really considered a bug or working as intended.
I'm using tl_content as an example but in general all tables with pid and sorting are affected.
When moving content elements from one place to another Contao may update the sorting value of surrounding elements which where not explicitly moved. As an example lets say we have an article with 5 content elements in it:
Now I want to move the elements with ID 4 and 5 between 2 and 3. To do this I select ID 4 and 5, click "Cut" and then "Paste after" ID 2. This results in the following data:
ID 4 and 5 have updated sorting values to represent their new position and updated tstamps as I explicitly moved them. ID 3 also has an updated sorting value as it had to move down to make place for ID 4 and 5., BUT ID 3 does NOT have an updated tstamp as it was not moved explicitly.
Depending on the definition you could either say that ID 3 should have a new tstamp, as it has technically changed, but you could also say it should not have a new tstamp as it was not changed by a user.
The reason I even bring this topic up is the following: we have custom code in place to keep two Contao systems in sync. That means if something changes in system 1 it should also get updated in system 2. The tstamp is used to detect and sync any changes, otherwise we would always need to check all database entries for changes, as usually the tstamp gets updated if something changes. Except in this specific case.
I'm really not sure if that is an issue for anyone except me and if it should be changed or not. If it will be changed, as far as I know the following 3 statements in
DC_Table
would need to also update the tstamp:contao/core-bundle/contao/drivers/DC_Table.php
Lines 1389 to 1392 in 28c3779
contao/core-bundle/contao/drivers/DC_Table.php
Lines 1447 to 1449 in 28c3779
contao/core-bundle/contao/drivers/DC_Table.php
Lines 1565 to 1567 in 28c3779
The text was updated successfully, but these errors were encountered: