%#d doesn't work on Solaris, OSX and BSD

Bug #795494 reported by Steve Bailey
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
François Marier

Bug Description

The day of the month (e.g. 1st, 3rd, etc.) in Tasks within a Plan are all displayed as "#d" in Mahara 1.4 rc4. This only happens when viewing tasks (although both in Content>Plans and the block within a Page), as when editing the date appears in full. I'm running this using XAMPP on OSX, MySQL5. Appears in all browsers tested on Mac & PC.

Tags: osx
Revision history for this message
Steve Bailey (stevobailey) wrote :
Revision history for this message
François Marier (fmarier) wrote :

That looks like an incompatibility with PHP on OSX, because it works fine on Linux.

I'm not entirely surprised because we've had a similar problem on Windows.

Changed in mahara:
importance: Undecided → Medium
status: New → Triaged
tags: added: osx
Revision history for this message
Worth Bishop (wbishop) wrote :

Same problem running Mahara 1.4.0 under FreeBSD 8.0, PostgreSQL 8.3, PHP 5.3.3.

Revision history for this message
François Marier (fmarier) wrote :

I guess we either need to switch to using %d and get used to seeing leading zeroes all over the place, or we need to write a wrapper function that will get used whenever we need to print a date.

Changed in mahara:
milestone: none → 1.5.0
summary: - Day-of-month in Completion date of Tasks displayed incorrectly.
+ %#d doesn't work on Solaris, OSX and BSD
Melissa Draper (melissa)
Changed in mahara:
assignee: nobody → Melissa Draper (melissa)
status: Triaged → In Progress
Revision history for this message
Melissa Draper (melissa) wrote :

I've pushed https://reviews.mahara.org/917 for this.

Steve and Worth, if you're able to, could you check if this patch helps? Let us know if you need to be walked through doing so.

Revision history for this message
Steve Bailey (stevobailey) wrote :

Thanks for this, but it doesn't seem to work. I applied the patch (after reading up on that), and checked that the changes have been made in the patch (I used the backup option), and this seems to have been applied. However, the day number now doesn't appear at all; it just shows the month and year. I've attached a screen shot. Let me know if you'd like me to upload any other files.

Revision history for this message
Melissa Draper (melissa) wrote :

Hi Steve,

Thanks for checking the patch for us, it's very much appreciated.

I can see I didn't clean it up very well, so here is an updated version for you to try.

Thanks
Melissa

Revision history for this message
Steve Bailey (stevobailey) wrote :

No problem at all Melissa, just glad I can be of some (minor) help, and thank you for your work on this. This patch works a treat on my system (Mac OSX Lion, XAMPP). Screen shot attached for comparison. Steve

Changed in mahara:
assignee: Melissa Draper (melissa) → François Marier (fmarier)
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/919
Committed: http://gitorious.org/mahara/mahara/commit/56b3b65620a1d70c309a7e07686eed61fcce6ec1
Submitter: Hugh Davenport (<email address hidden>)
Branch: master

commit 56b3b65620a1d70c309a7e07686eed61fcce6ec1
Author: Francois Marier <email address hidden>
Date: Fri Dec 9 14:59:44 2011 +1300

    Work-around missing %e in format_date on Windows

    This comes from:

      http://nz.php.net/manual/en/function.strftime.php#example-665

    Bug #795494

    Change-Id: Ie958f1ac6cfcb89dfa34f552c7eeec16be4578d7
    Signed-off-by: Francois Marier <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/920
Committed: http://gitorious.org/mahara/mahara/commit/92cfb32bd73469aa3d85d86bc3e6c6667b5491d8
Submitter: Francois Marier (<email address hidden>)
Branch: master

commit 92cfb32bd73469aa3d85d86bc3e6c6667b5491d8
Author: Melissa Draper <email address hidden>
Date: Fri Dec 9 15:05:48 2011 +1300

    Use the strftime wrapper (format_date) everywhere

    The format_date function is a wrapper for strftime, and we
    added logic to it for working around the %e parse failure
    of strftime on Windows.

    Bug #795494

    Change-Id: Ib4be53194e95e03fbb8a24da98ef61327aa3eea5
    Signed-off-by: Melissa Draper <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/1080
Committed: http://gitorious.org/mahara/mahara/commit/5227f0a0f3dca20a47b684628bd228d0d64579a2
Submitter: Hugh Davenport (<email address hidden>)
Branch: master

commit 5227f0a0f3dca20a47b684628bd228d0d64579a2
Author: Francois Marier <email address hidden>
Date: Tue Feb 28 16:46:29 2012 +1300

    Revert "Date format for windows(bug #671456)"

    While this fixed dates on Windows, it broke them on Solaris,
    OSX and BSD (bug #795494).

    This reverts commit c78df32c3d8060f6c7115eb217b03212cf9e5749.

    Change-Id: Ib74acd94ae202ec65cd6c08369e258c3c750aacc
    Signed-off-by: Francois Marier <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Melissa Draper (melissa)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.