Activity Tracker shows 'Last updated' status as '45 years 1 week ago' for all the content added.

Steps:
1. Install / Enable Tracker Module
2. Add any content
3. Check the activity by going to user -> Activity
4. Last updated is shown as '45 years 1 week ago'

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because tracker functionality is broken.
Issue priority Normal
Unfrozen changes None
Prioritized changes The main goal of this issue is fixing a bug.
Disruption None
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Poornima3’s picture

This is particularly happening for just content type:- Basic Page (For Article it is showing the correct last updated )

Manjit.Singh’s picture

Status: Active » Needs review
a_thakur’s picture

Status: Needs review » Needs work
a_thakur’s picture

Status: Needs work » Needs review
FileSize
79.71 KB
79.15 KB
629 bytes

Please find the attached patch. Also find the screenshots for before and after patch.

Status: Needs review » Needs work

The last submitted patch, 4: tracker_module_fix-2401191-4.patch, failed testing.

dawehner’s picture

Version: 8.1.x-dev » 8.0.x-dev

Afaik it is always time to fix bugs.

a_thakur’s picture

Not sure why test fails, is it because tracker module isn't enabled on the instance where CI is running?

Status: Needs work » Needs review
Poornima3’s picture

#4

The patch works absolutely fine

mohrerao’s picture

Issue tags: +#dcdelhi

ashutoshsngh’s picture

Status: Needs review » Reviewed & tested by the community

Applied and checked worked fine.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

We should have a test for this.

RavindraSingh’s picture

Status: Needs work » Reviewed & tested by the community

Yes, its working fine.

RavindraSingh’s picture

Status: Reviewed & tested by the community » Needs work

what other people say?

jhedstrom’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
2.94 KB
1.7 KB
2.53 KB

I started writing a test for this, and quickly realized that the issue only makes itself apparent when comments are disabled on a particular type. Furthermore, the changed time from the tracker data table can include comment updates, not just node time.

I've written a test that illustrates the failure, and also tweaked the fix from above to take into account comment time (but still include changed time from nodes without comments).

The last submitted patch, 16: activity-tracker-time-display-2401191-16-TEST-ONLY.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 16: activity-tracker-time-display-2401191-16.patch, failed testing.

Status: Needs work » Needs review

The last submitted patch, 16: activity-tracker-time-display-2401191-16-TEST-ONLY.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 16: activity-tracker-time-display-2401191-16.patch, failed testing.

idebr’s picture

Issue tags: +Needs reroll
jhedstrom’s picture

Re-roll of #16.

Status: Needs review » Needs work

The last submitted patch, 25: activity-tracker-time-display-2401191-25-TEST-ONLY.patch, failed testing.

jhedstrom’s picture

Status: Needs work » Needs review

The test-only patch was expected to fail.

Anonymous’s picture

Status: Needs review » Needs work

Looking over the patch, it seems ok to me. But I do have some minor remarks:

  1. +++ b/core/modules/tracker/src/Tests/TrackerTest.php
    @@ -8,7 +8,9 @@
    +
    

    Nitpicking, but it's not needed here :)

  2. +++ b/core/modules/tracker/tracker.pages.inc
    @@ -61,12 +61,15 @@ function tracker_page($account = NULL) {
    +      // Set last activity time from tracker data (this isn't only the node
    +      // changed time, it can include comment activity, so getChangedTime() is
    +      // not used.
    

    This is missing a closing bracket, but I would prefer to rephrase the comment altogether.
    E.g.
    Set the last activity time from tracker data. This also takes into account comment activity, so getChangedTime() is not used.

nlisgo’s picture

Status: Needs work » Needs review
FileSize
1.2 KB
2.51 KB

This patch addresses feedback in #28.

Anonymous’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Looks good to me.

Added beta eval to the summary.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Great catch.

Committed and pushed to 8.0.x. Thanks!

  • webchick committed 3142e86 on 8.0.x
    Issue #2401191 by jhedstrom, a_thakur, nlisgo, mohrerao: Activity...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mohrerao’s picture