Page MenuHomePhabricator

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in GrowthExperiments/includes/UserImpact/ExpensiveUserImpact.php on line 144
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Access Special:Homepage locally with new impact enabled

What happens?:

A deprecation warning shows:

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /var/www/html/w/extensions/GrowthExperiments/includes/UserImpact/ExpensiveUserImpact.php on line 144

What should have happened instead?:

No deprecation warning

Software version (skip for WMF-hosted wikis like Wikipedia):

urbanecm@wmf3345 GrowthExperiments % git show -s HEAD
commit 68c84322cfdc944ed975ed4bc30b46578521a469 (HEAD -> master, origin/master, origin/HEAD)
Author: [BOT] Translation updater bot <l10n-bot@translatewiki.net>
Date:   Thu Oct 19 08:42:19 2023 +0200

    Localisation updates from https://translatewiki.net.
    
    Change-Id: If2a376ef3982790b9f2f2a5a60d325c87aab00bc

urbanecm@wmf3345 core % git show -s HEAD
commit 5df8b7758d4acd70430053d7c00acea74995866a (HEAD -> master, origin/master, origin/HEAD)
Author: [BOT] Translation updater bot <l10n-bot@translatewiki.net>
Date:   Thu Oct 19 08:22:51 2023 +0200

    Localisation updates from https://translatewiki.net.
    
    Change-Id: I11f571d1349dbb683594340da5f753c81db84e65
urbanecm@wmf3345 core %

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 968761 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] ExpensiveUserImpact: Do not pass null to DateTime constructor

https://gerrit.wikimedia.org/r/968761

Urbanecm_WMF triaged this task as Medium priority.

Upon reviewing this, I feel like ExpensiveUserImpact::isPageViewDataStale returns false for no-pageview scenario, even though it probably shouldn't. See justification in the commit message.

Change 968761 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] ExpensiveUserImpact: Do not pass null to DateTime constructor

https://gerrit.wikimedia.org/r/968761