Notification url field contains wwwroot

Bug #849716 reported by Richard Mansfield
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Richard Mansfield

Bug Description

The notification_internal_activity table has a url field which is used to provide the user with a link to whatever thing the notification is about. This url includes the site's wwwroot. That's useful when it's sent out in an email, but it's not cool for the internally stored notifications, because if the site's wwwroot changes, all those old links will break. We should just store the local url without the wwwroot.

It's probably a good idea to upgrade & remove all wwwroots from old notifications - carefully, because it's a big table.

Changed in mahara:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
François Marier (fmarier) wrote :

We should probably just ignore the old notifications and only fix the new ones.

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

It would be nice to fix this in 1.5 since we are planning to migrate mahara.org to https at some point.

Changed in mahara:
milestone: none → 1.5.0
tags: added: wwwroot
Changed in mahara:
assignee: nobody → Richard Mansfield (richard-mansfield)
Revision history for this message
François Marier (fmarier) wrote :
tags: added: notifications
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/879
Committed: http://gitorious.org/mahara/mahara/commit/4384e74773f660cd24da9e9f2d4deb897eb88e73
Submitter: Richard Mansfield (<email address hidden>)
Branch: master

commit 4384e74773f660cd24da9e9f2d4deb897eb88e73
Author: Richard Mansfield <email address hidden>
Date: Wed Nov 23 18:22:21 2011 +1300

    Remove wwwroot from notification urls (bug #849716)

    Urls stored in the url field of notification_internal_activity contain
    the site's wwwroot. This leads to broken links when the wwwroot is
    changed. It also dangerously turns what should be local links into
    remote ones when for example a production database is copied into a
    test Mahara instance.

    This patch does three things:
    - Removes the wwwroot from urls passed to ActivityType constructors
    - Adds the wwwroot back on the url when sending email and emaildigest
      notifications, and when displaying them on the site.
    - Removes the wwwroot from the url in all existing rows of
      notification_internal_activity.

    Change-Id: I00ae1abc65be79030ed4c572ce951edc43f7a034
    Signed-off-by: Richard Mansfield <email address hidden>

Changed in mahara:
status: Confirmed → Fix Committed
Revision history for this message
Melissa Draper (melissa) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 status fixreleased
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPjqRqAAoJECXBtiziiXdcClMH/iCpqPI1raL+Yxfs36gNU1C+
T5NzOsB7syaBTCGI8mxndYfAY4iEcmnECGuSSios3Oeuu8j+O/fE/yg/yTbycZxk
+LypupaD8wFDhSmdVe6dKx6XOxEMAfGnkED2+StzJwObZJ6bIeST7idjQV9ii1v7
XyxTj7qiFHHYSlugXR2UO01yU7emF7Q8qCDhKuwjsrueXojEuTl0c9kOUNQ4k9hE
W8/CK6NOqqxoY8m6r8yq2YMM01/UisE/ZSCpHws9+MRYoNIMh5mCigVJRwzQMHFy
yczHux0L+2to3+uQ7/1BYPaBZwMIxCPPOBFdDe73164GwtSphHFDXztBdDCAXxA=
=srG6
-----END PGP SIGNATURE-----

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.