#20274SYS_LASTCHANGED should not change when only page permissions are changed (but it does)
Description
There is a problem with the behavior of TYPO3 and the “access module”. When admin user changes permissions for a backend group, SYS_LASTCHANGED is changed too.
So, when I use TypoScript to show last updated in frontend page, the date is updated but no content has changed.
My TS code :
lib.objPiedPage.5.30 = TEXTlib.objPiedPage.5.30.data = page:lastUpdated
lib.objPiedPage.5.30.if.isTrue.Data = page:lastUpdated
lib.objPiedPage.5.30.strftime = %e %B %Y
lib.objPiedPage.5.30.wrap=
Last update: |
lib.objPiedPage.5.30.data = register : SYS_LASTCHANGED
lib.objPiedPage.5.30.if >
(issue imported from #M10841)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 1
History 13
-
Thomas Trethan commented and changed target version <span data-processor="relativetime" data-value="2011-04-18T18:19:30+00:00" > 04/18/11, 18:19 </span>
-
Ingo Pfennigstorf commented <span data-processor="relativetime" data-value="2012-04-17T12:23:10+00:00" > 04/17/12, 12:23 </span>
Also related #34219 where SYS_LASTCHANGE is updated whe changing records in the workspace
-
Michiel Roos commented <span data-processor="relativetime" data-value="2014-12-12T15:17:56+00:00" > 12/12/14, 15:17 </span>
Thomas,
No, it should change. The value is used to generate the ‘Last Modified’ header. If you do not change that when the content changes . . . A user with a cached version (in the browser) will check with the server when that page expires. The server will then however tell the user that the page has ‘not’ changed. The user will then NEVER see the new comment, perpetually serving up the content from his own cache.
-
Alexander Opitz changed description parent task #63815 Is Regression 0 <span data-processor="relativetime" data-value="2014-12-12T15:37:50+00:00" > 12/12/14, 15:37 </span>
-
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2015-07-08T10:17:11+00:00" > 07/08/15, 10:17 </span>
I used the typoscript included to test on both 6.2.14 and 7 (latest master):
page.40 = TEXT page.40.data = page:lastUpdated page.40.if.isTrue.Data = page:lastUpdated page.40.strftime = %e %B %Y %H:%M:%S page.40.wrap= <p> Last update: |</p> page.40.data = register : SYS_LASTCHANGED page.40.if >
then I changed the permissions of one page (changed the group, or the owner, or the permissions)
my results:TYPO3 6.2.14 > bug still present
TYPO3 7 (latest master) > bug NOT present -
Annina H commented <span data-processor="relativetime" data-value="2015-08-31T10:08:38+00:00" > 08/31/15, 10:08 </span>
Not sure if it’s related. I am using TYPO3 7.4.0 with the Introduction Package on a local installation with XAMPP (Windows 7 Enterprise, 64 bits):
SYS_LASTCHANGED seems to be updated only when the page (properties) itself is modified. Changing a content element does not affect the field value.
-
Florian Seirer commented <span data-processor="relativetime" data-value="2015-08-31T10:17:13+00:00" > 08/31/15, 10:17 </span>
The cache of that page has to be rewritten for SYS_LASTCHANGED to be updated.
-
Annina H commented and changed attached t3tt_contentVSpages.PNG <span data-processor="relativetime" data-value="2015-08-31T11:56:14+00:00" > 08/31/15, 11:56 </span>
It’s not updated even after clearing all caches and temp files… See screenshot of the two database tables.
-
Riccardo De Contardi changed category target version <span data-processor="relativetime" data-value="2015-11-22T16:17:24+00:00" > 11/22/15, 16:17 </span>
-
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2019-02-19T00:17:56+00:00" > 02/19/19, 00:17 </span>
My previous test was wrongly performed, I should have used
config.no_cache=1This is the short test I performed on a new 9.5.4:
1) I used the following TypoScript:
config.no_cache=1 page=PAGE page.40 = TEXT page.40.data = page:lastUpdated page.40.if.isTrue.Data = page:lastUpdated page.40.strftime = %e %B %Y %H:%M:%S page.40.wrap= <p> Last update: |</p> page.40.data = register : SYS_LASTCHANGED page.40.if > page.100 =< styles.content.get
Results:
1) Change the permissions of the page >> the SYS_LASTCHANGED field is updated*
2) Change one of the content elements on the page >> the SYS_LASTCHANGED field *is not updated -
Benni Mack commented <span data-processor="relativetime" data-value="2019-03-24T13:04:39+00:00" > 03/24/19, 13:04 </span>
Hi Riccardo, SYS_LASTCHANGED is updated when the frontend is actually called!
-
Riccardo De Contardi commented and changed TYPO3 Version
4.211 PHP Version4.38.1 <span data-processor="relativetime" data-value="2023-05-06T13:51:01+00:00" > 05/06/23, 13:51 </span>Hi Benni and sorry for the late reply
IIRC I actually visited the frontend to see the change on the SYS_LASTCHANGED field printed via TypoScript on the page itself.
I repeated the test on comment 10 on TYPO3 11.x and 13.0.0-dev
Here the results:
1) Change the permissions of the page >> the SYS_LASTCHANGED field is updated
2) Change one of the content elements on the page >> the SYS_LASTCHANGED field is not updated
3) Change a property of the page (e.g. the “alternative navigation title” field) >> the SYS_LASTCHANGED field is updatedI raise the TYPO3 version to 11
-
Georg Ringer commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-10-23T14:30:09+00:00" > 10/23/26, 14:30 </span>Thanks for the report and the detailed tests.
I checked this on current main (v14/15 development). The behaviour is still the same, but it is by design:
DataHandlersets thetstampfield of a record on every change, no matter which field was edited. A change ofperms_*from the access module goes through the regularpagesdatamap, so it updatespages.tstamplike any other page property.- The frontend initializes the “last changed” value from
max(pages.tstamp, pages.SYS_LASTCHANGED)(PrepareTypoScriptFrontendRendering) and writes it back toSYS_LASTCHANGEDwhen the page is rendered. Therefore a permission change, like a change of the page title, movesSYS_LASTCHANGED.
If a date for “last content change” is needed, it can be rendered from the content records’
tstampvia TypoScript, or an extension can set a dedicated field. Installations that do not want a permission change to touch the page can adapt this with theprocessDatamap_postProcessFieldArrayDataHandler hook: it is called aftertstamphas been added to the field array, so a hook implementation can unsettstampforpagesif the remaining fields are onlyperms_*.
Closing as “works as designed”.
generally it would be great to be able to define what action causes an update of SYS_LASTCHANGED. For example if a new comment is posted (via frontend) I’d prefere to remain SYS_LASTCHANGED unchanged, since the article itself did not change.