Commit graph

536 commits

Author SHA1 Message Date
Bartosz Dziewoński
dfc3e3df90 Correctly update wl_notificationtimestamp when viewing old revisions
== Prelude ==
wl_notificationtimestamp controls sending the user e-mail
notifications about changes to pages, as well as showing the "updated
since last visit" markers on history pages, recent changes and
watchlist.

== The bug ==
Previously, on every view of a page, the notification timestamp was
cleared, regardless of whether the user as actually viewing the latest
revision. When viewing a diff, however, the timestamp was cleared only
if one of the revisions being compared was the latest one of its page.

The same behavior applied to talk page message indicators (which are
actually stored sepately to cater to anonymous users).

This was inconsistent and surprising when one was attempting to, say,
go through the 50 new posts to a discussion page in a peacemeal
fashion.

== The fix ==
If the revision being viewed is the latest (or can't be determined),
the timestamp is cleared as previously, as this is necessary to
reenable e-mail notifications for given user and page.

If the revision isn't the latest, the timestamp is updated to
revision's timestamp plus one second. This uses up to two simple
(selectField) indexed queries per page view, only fired when we
do not already know we're looking at the latest version.

Talk page indicator is updated to point at the next revision after the
one being viewed, or cleared if viewing the latest revision. The
UserClearNewTalkNotification hook gained $oldid as the second argument
(a backwards-compatible change). In Skin, we no longer ignore the
indicator being present if we're viewing the talk page, as it might
still be valid.

== The bonus ==
Comments and formatting was updated in a few places, including
tables.sql and Wiki.php.

The following functions gained a second, optional $oldid parameter
(holy indirection, Batman!):
* WikiPage#doViewUpdates()
* User#clearNotification()
* WatchedItem#resetNotificationTimestamp()

DifferenceEngine gained a public method mapDiffPrevNext() used
to parse the ids from URL parameters like oldid=12345&diff=prev,
factored out of loadRevisionIds(). A bug where the NewDifferenceEngine
hook would not be called in some cases, dating back to its
introduction in r45518, was fixed in the process.

Bug: 41759
Change-Id: I4144ba1987b8d7a7e8b24f4f067eedac2ae44459
2013-10-27 17:47:53 +00:00
umherirrender
ce801197c9 Pass language to File::getDescriptionText
Follow-Up: Ifcae821a51f4207e7816e710d3b3857c7ed438b6
Change-Id: I8e13f672fd37319add1c090a5b2f38c45d18fda5
2013-10-25 00:04:12 +00:00
umherirrender
ed50986174 Use redirect=no for links to file redirects in "file usages" section
Bug: 50051
Change-Id: Ie77af42b2d9183ba2f56a300a6604c3f71ee89b8
2013-09-06 20:32:49 +00:00
TheDJ
75da5baa3f Merge "Set modes back to 0644 to ImagePage.php and Resources.php" 2013-08-18 12:05:03 +00:00
Alexandre Emsenhuber
61b93a4cd9 Set modes back to 0644 to ImagePage.php and Resources.php
Fix for Icd1cde7c62 (427b0e1).

Change-Id: I981a84c1b2f3997daa590acad422445e3640b5fb
2013-08-18 11:16:36 +02:00
TheDJ
5c5fb511c7 Merge "Make image pagination not require a page load." 2013-08-15 20:31:27 +00:00
balloonguy
427b0e1bf9 Make image pagination not require a page load.
Progressively enhance multi-page image navigation so that the paginated
part is changed without requiring a full page load. Currently, the url
is not updated to reflect the current page after navigation occurs, but
if desired, this functionality could be added using history.pushState.

Bug: 40207
Change-Id: Icd1cde7c62c4d462f5b697b9f49f5c08f6e7482b
2013-06-22 15:19:35 +02:00
jarry1250
3f5d41d413 The language used to render SVGs should be definable
See bug for context.

The implementation is slightly untidy because I've written it so
as to avoid invalidating the existing SVG thumbs -- there will be
no immediate difference (visual/performance/other) as a result of
this.

Tested by me in both...
* [[File:Example.svg|thumb|lang=fr]] AND
* http://example.org/w/index.php?title=File:Example.svg&lang=fr
...modes. Example file on
https://commons.wikimedia.org/wiki/File:Gerrit_patchset_25838_test.svg

Added parser tests.

Bug: 32987
Change-Id: I4cadf96ecd5e169a88ad468a0478d355db980103
2013-06-05 19:28:03 +00:00
Siebrand Mazeland
59f6fd0199 Change EXIF to Exif
Per https://en.wikipedia.org/wiki/Exchangeable_image_file_format. Spotted
by Shirayuki and documented on
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Sesp-property-exif-data/en

Change-Id: I92ba67ec60ccfe7a173d950593357b86792b8ed3
2013-05-10 13:51:06 +02:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
Chad Horohoe
4be6236352 Remove externaledit/externaldiff preference
Change-Id: Ic3791d188688f556753ab5556a4d9733bbf2e85e
2013-04-11 09:20:36 -04:00
Alexandre Emsenhuber
15833dafdf Fix case of some Title methods
Change-Id: I1a37ffb0e8cde4deac027721b0e463585b58d634
2013-03-26 10:54:15 +01:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls

Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"

Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
2013-03-13 03:42:41 -04:00
jenkins-bot
fac1ec45f1 Merge "Don't use isset() to check whether an existing variable is null" 2013-03-12 15:08:56 +00:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Alexandre Emsenhuber
c6a889acc4 Don't use isset() to check whether an existing variable is null
Change-Id: Ie63f060fb7928fd51a8ad71293955f923f6a18c3
2013-03-10 16:23:46 +01:00
umherirrender
de7380b56e Change intval( User::getOption() ) to User::getIntOption()
Also changed some getOption with int or bool cast

Change-Id: Ia551a50e9de047c62be84065481fdf8c02e2ef96
2013-03-04 14:08:48 +00:00
IAlex
0cce298226 Merge "fix some spacing" 2013-02-10 12:47:01 +00:00
umherirrender
c598851620 Avoid undefined offset for $wgImageLimits
This can happen, when customized $wgImageLimits, but not
the option in $wgDefaultOptions

Notice:  Undefined offset: 2 in \includes\ImagePage.php on line 364

Change-Id: I1dbcde8782f239279602f509e5987606af8db241
2013-02-10 13:36:25 +01:00
umherirrender
ca31ebad3f fix some spacing
Added/removed spaces after opening/before closing parentheses

Added a space after a comma

Removed unneeded parentheses in condition

Change-Id: I306091347ccaaf11dee0cdfda3019cb0c12be51b
2013-02-09 23:03:53 +01:00
IAlex
fd03fa2825 Merge "Show no size links on image pages with errors" 2013-02-07 11:13:36 +00:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
umherirrender
d1647fe4ac Show no size links on image pages with errors
This avoids useless
"Size of this preview: . Other resolutions:  |  |  | ."
on image pages.

Change-Id: Ieb2787a736ec5ae409ad17dd9919f4975f0b843e
2013-02-02 12:29:49 +01:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00
jenkins-bot
90bf090dd3 Merge "Cleanup to ImagePage::openShowImage()" 2013-01-22 20:00:42 +00:00
raymond
0856c00435 Cleanup HTML of imagepage: avoid empty <ul></ul>
This happens when a redirect without usages exists
While I am in this section: Use modern Html() function

Change-Id: I1af206ab3a83fb0d09773314bb30db01f557ba07
2013-01-15 07:31:27 +00:00
Tim Starling
e0a78d0a33 Introduce $wgEnableCanonicalServerLink
(bug 43466) If enabled, send a rel=canonical link on every page
indicating the correct server to use. I tested all three callers:
Article, ImagePage and the variant feature in getHeadLinksArray().

Change-Id: I59b7c1d5589825ea390967036190218d5ce2db88
2013-01-07 01:04:05 +00:00
Alexandre Emsenhuber
33a5af1d2d Cleanup to ImagePage::openShowImage()
- Removed useless $showLink variable and related check since the variable is always defined to true
- Moved $linktext up so that there's no need to use a temporary variable to modify it
- Moved $longDesc down where it's used
- Change "else { if ( ... ) { } }" to elseif for better clarity

Change-Id: I65dcbb76c7f0a0441a6420e76affe797a3dc9c45
2012-12-20 22:24:54 +00:00
umherirrender
b6f1f03ae0 Set correct context for ImageHistoryPseudoPager
ContextSource::getContext (ImageHistoryPseudoPager): called and $context
is null. Using RequestContext::getMain() for sanity

Change-Id: I0430791a705f42ca3e5d02692070f0fb0dadc897
2012-12-20 19:21:15 +00:00
Reedy
4a5676d997 Leave some FIXME comments for Bug 36911 - Division by zero
Change-Id: I994c482cad1d195cf29d18f7ccf1d8816b1e7330
2012-12-06 23:59:18 +00:00
daniel
b6b686c13b merged master
Change-Id: I0ef7c7f33a5dc5855f38b20c03ddc5306f38ec66
2012-09-19 12:34:10 +02:00
Derk-Jan Hartman
287c78dea8 (bug 39538) SVG filepages do not need the file-nohires message.
Change-Id: I88b75079d09cc3ab1904a0a2d716fe2df57b7be6
2012-09-11 23:48:01 +02:00
daniel
12166f46b4 merged master (2012-09-11)
Change-Id: I8e953eaa22f9d331b0af5e780fbeff6d702b23e3
2012-09-11 11:43:02 +02:00
Aaron
a73d0df62a Revert "(bug 27111) Make cascading foreign repo's fetch description properly"
The combination of $out->addHTML() and the super call cause action=render for
File pages to have the text rendered twice. Wikis get commons descriptions via
action=render, so they were showing the description text twice.

This reverts commit ca13fde652.

Conflicts:

	RELEASE-NOTES-1.20

Change-Id: Ib1072fd1d109c0d6706215ccad1413dd72cb201d
2012-09-05 12:22:14 -07:00
daniel
b6fe213226 merge latest master.
some tests fail due to logical changes, will fix that in a follow-up

Change-Id: I8a5e4087ecf674fbcf6327c5d168cd401be12400
2012-09-05 17:50:13 +02:00
Hashar
89a055491c Merge "'lang' attrib in #mw-content-text should be set to variant code." 2012-09-04 15:04:52 +00:00
Liangent
da43314022 'lang' attrib in #mw-content-text should be set to variant code.
Change-Id: I15cd8c102991c5007b43e06939a0c1a7593d0933
2012-09-04 17:00:27 +02:00
daniel
9994968774 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 15:20:15 +02:00
Daniel Kinzler
392af46809 Revert "merged master"
This reverts commit 67bfdc7a68
2012-08-29 13:14:49 +00:00
daniel
67bfdc7a68 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 12:06:38 +02:00
Brian Wolff
ca13fde652 (bug 27111) Make cascading foreign repo's fetch description properly
This changes action=render on file pages to include the shared image
description (if it exists). The reasons for this are two fold:

*Logically, most users would consider the shared description part of
  the content of the page, and not part of the site chrome, so it
  should be on action=render
*Foreign file repos use action=render to get image descriptions.
  if you use say en.wikipedia.org as your file repo, commons images
  get cascasively included, but all their descriptions end up
  being the noarticletext message, which is bad. This makes
  the shared image descriptions work.

Some notes on the implementation:
* on action=render the div containing the shared description
  doesn't have the id that the one on normal page view has.
  This is to prevent duplicate ids in the cascading repo scenario.
  I added a class so people can identify them if they want, and this
  allows people to easily identify the "outermost" shared description
  as it would be the only one with the id.
* This doesn't include the "shareddescriptionfollows" message
  (which is disabled by default) that would normally separate the
  local from the non-local description. I wasn't sure, but thought
  that would be considered part of the site chrome.

Patchset 2/3: trailing space/spelling mistake
Patchset 4: rebase

Change-Id: I18bdf29de62526d699740607b5015da4b01fd43d
2012-08-23 15:44:23 -03:00
Siebrand Mazeland
bb17f98644 (bug 39563) Fatal error: Inaccessible function via __call(): msg
Change-Id: I706ce99400edb86740afc5ce8b205030be7f3c68
2012-08-22 20:54:38 +02:00
Alex Monk
d04502b698 (bug 24491) Don't show reupload link if the user can't upload because of protection
Instead, show some text explaining that they cannot upload here.

Also remove a linebreak which someone complained about recently.

Change-Id: I92ab8ad5eebcdd38c0d5d9f7bab7d11e5c844586
2012-08-21 19:06:42 -07:00
Brian Wolff
876128f8c9 (bug 39297) Show a warning if thumbnails won't be animated
This shows a warning on the image description page if the image
is animated, but thumbnails won't be. This includes
gif images that are too big, but also svg images that are animated,
and APNG files.

The message used is file-no-thumb-animation, but will also
check for file-no-thumb-animation-<image extension> so that
admins can do per image type explanations. Gif files have a built-in
explanation that is slightly different (Since its do to resolution).
Ideally one would pass the resolution limit to the gif message,
but I couldn't think of a clean way of doing that. (Also might be
complex to explain to user. They aren't used to resolution as a single
number but as a width x height type thing).

Moves isAnimatedImage from ImageHandler to MediaHandler, so I could
safely use it from any handler class.

Change-Id: I42ee11d889e0c41de53d0951f55a4338ca55311d
2012-08-21 18:31:51 -07:00
Siebrand Mazeland
6fe1f0509b Replace deprecated wfMsg* calls with Message class calls.
Doing this in steps of roughly 100 changes per commit, so that it remains reviewable.

Change-Id: Ib15e670badd3f6aecae8b60e2f9129a31341ce16
2012-08-21 18:38:44 +02:00
daniel
c0b50eb47d merged master
Change-Id: I6afafe971afb3f38fc8f1e66ba409283b8a698f8
2012-08-02 11:01:22 +02:00
Derk-Jan Hartman
8fa160aadb bug 36073 Use mw-imagepage-linkstoimage-ns as a class instead of an ID
This avoids multiple defines of the same ID on a File page.

Change-Id: I0f8ae37d74f2ec519361b2af164e115f6efa4ac6
2012-08-01 21:34:34 +02:00
Siebrand
7ab935b039 Merge "Use local context to get messages and time formatting methods of Language class." 2012-07-29 20:46:40 +00:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00