Page MenuHomePhabricator

Template {{CURRENTWEEK}} is unstable
Closed, ResolvedPublic

Description

Author: folengo

Description:
Template {{CURRENTWEEK}} is unstable. Its value is at
times "02" with two digits, and at times "2" with only
one digit.

This bug happened this morning on fr.wikipedia.org.
Until then, the value was "2" with only one digit.

According to
http://meta.wikimedia.org/wiki/Help:Magic_words#CURRENT
WEEK , Template CURRENTWEEK is « A variable, returning
the number of the current week (1-52). »

As the author wrote « (1-52) », not « (01-52) » the
value should have one digit until 9 and two digits
from 10 to 52.


Version: unspecified
Severity: minor

Details

Reference
bz4594

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:04 PM
bzimport set Reference to bz4594.
bzimport added a subscriber: Unknown Object (MLST).

avarab wrote:

RESOLVED WORKSFORME, can't reproduce this, we always produce a zero-padded
value, the documentation is wrong.

folengo wrote:

Thanks for your remark, but according to what I observed
on fr.wikipedia.org, the documentation was right until
yesterday.

By the way, Template {{CURRENTDAY}} also displayed only
one digit : "9" not "09", for example, last monday,
January 9th 2006.

If the change is definitive, it is not really a problem.
What is troublesome is that the value switches from "02"
to "2" and from "2" to "02" at random every minute or
possibly every second.

folengo wrote:

Here are two screenshots made a few minutes ago, showing
that {{CURRENTWEEK}} takes at turns both values :

http://img358.imageshack.us/img358/9964/currentweektest8c
e.jpg

http://img481.imageshack.us/img481/8190/currentweektest21
nq.jpg

avarab wrote:

Oh excellent, PHP5 has it zero padded but PHP4 does not, and since we're in the
process of an upgrade to PHP5 you're getting it zero padded and not zero-padded
depending on the server

REOPENING

avarab wrote:

FIXED in CVS HEAD

This bug has a parsertest called "Magic Word: {{CURRENTWEEK}} (@bug 4594)"

folengo wrote:

Should we expect the same change to occur with
{{CURRENTDAY}} with CURRENTDAY taking the value "01" on
February 1st 2006 instead of "1" like on January 1st
2006 ?

zigger wrote:

(In reply to comment #7)
Not according to the fix for bug 2522, which adds CURRENTDAY2.

zigger wrote:

(In reply to comment #8)

Not according to the fix for bug 2522, which adds CURRENTDAY2.

Sorry, I got that backwards.

This PHP bugfix in the recent v5.1.2 could be related:
http://bugs.php.net/bug.php?id=34302

zigger wrote:

(In reply to comment #9)

...
This PHP bugfix in the recent v5.1.2 could be related:
...

should have typed v5.1.0