query=revisions can be used with rvprop=content to retrieve the
content of revisions. The contentmodel should always be included
with the content (just like the contenformat is), so the client
is able to interpret the structure contained in the content blob.
Change-Id: I67cf48f905ff83a86992e1a54f7ad0feaf2b2c94
diff3 issues a warning to stderr if any of the files does not end with a
newline character.
TextContent::preSaveTransform() does normalize revision text by simply
calling trim(). Thus to avoid a diff3 error we simply apply the same
normalization and add a newline to please the command.
Change-Id: I7baa3df95dd70cbc865b2491ccc791e60f8b9e6e
This provides several test cases for EditPage, including some for
detecting and resolving edit conflicts. This is in preparation for
finding and eliminating the root cause of bug 41352.
Change-Id: I8f23c6535f7b3ee6462d9c5a19dd06070e77f9d1
This change fixes fatal errors ocurring when Revision::loadText
returns false because of a failure to load the text blob.
Revision::getContent() should simply return null in such a case.
Change-Id: I1e13de14ff15b124b5a2e07155d368595a16fda7
- this is more generally useful than to be buried inside Wikibase client.
- it was in Wikibase/client/tests/phpunit/includes/store/EntityCacheTableTest.php
- patchset 2: add to test autoloader
Change-Id: I5bc41d6d205f28bcc5bf0c8a78b782c8888c18eb
* This can speed up certain video file operations for scripts that support
specifying source files via URLs and support HTTP Range headers.
* Updated unit tests.
Change-Id: I60cb95c2e3dd9f7df1f740e9182be7c79af69d6e
consistent with WikiPageTest and other places, perform the test
with the Help namespace as a workaround for now.
Change-Id: I2b766c17f35e0e79662b6302c122225a1a33e7be
This is needed to fix bug 41706 and similar, watch for follow-ups.
Automatic, implicit conversion may be handy in several cases, especially
for converting between different text based content models. E.g. it should
be possible to create a diff between a JavaScript and a wikitext page. This
change lais the foundations for this ability.
Change-Id: Ie7d87b67b24ac9897cb5696220a7785b228d3c79
The tests do lot of DB queries which are quiet slow when using a SQLite
backend. Marking the class as belonging to the 'medium' group should
raise the timeout to 10 seconds.
Change-Id: I7a779bf4e5f44e755055182e0feeb68c005a920c
This change provides a workaround and test case for a problem
in the sqlite library:
SQLite truncates strings at ASCII value 00 aka \0. Strings
containing \0 need to be represented in hexadecimal form.
Reported to PHP as bug 63419
https://bugs.php.net/bug.php?id=63419
Change-Id: I2bbc445ffebd41e181edfc3201e6e5514de06142
The Revision object needs the Title to determine the default content model.
Providing the Title explicitely wherever possible avoids an extra database
lookup. Most importanlty, this fixes fatal errors that ocurr when the
database lookup fails due to slave lag or transaction state.
Change-Id: I516e82f7a893b274c513b128b8a46db491160b55
The CDB tests were attemptying to write in harcoded filename
/tmp/php.cdb and /tmp/dba.cdb. Whenever two jobs were running the same
test, we would end up with a mysteriously failling test. The test now
use random temporary file names.
Change-Id: Ia1e58f0c02418e6d01d6730f97b2103ed87eb4f4
ORMRow shouldn't apply the "IGNORE" modifier for insertions by default.
IGNORE means pretending the insert was successfull even if it wasn't.
That's not a good default, and for some databases (like sqlite), may
actually hide errors beyond key conflicts.
Change-Id: I8b00cd03a459419441195ed25091385371b027a5
* This lets callers use "copy if exist" semantics more easily and avoids extra stat
queries to the backend (since the cache is cleared before doOperations()).
* Tweaked FileOp::fileSha1() to reduce backend stat requests as 404s are not cached.
Change-Id: Icb5ca14b3316f273d53593f48979d14e113990e1
According to standard the default type for <button> elements is "submit". Depending on compatibility mode IE might use "button", instead.
To work around the IE bug this patch forces the standard "submit", if nothing is specified explicitly.
See remarks on http://msdn.microsoft.com/en-us/library/ie/ms535211%28v=vs.85%29.aspx :
-----
The default value of the type attribute depends on the current document compatibility mode. The default value is submit. In other compatibility modes the default value is button.
...
Windows Internet Explorer 8 and later. The default value of the type attribute depends on the current document compatibility mode. In IE8 Standards mode, the default value is submit.
In other compatibility modes and earlier versions of Windows Internet Explorer, the default value is button.
-----
Change-Id: I3b97a8cac74bbfca63699dfcbf1cc5e9a2cef193
The bug has actually already been fixed, so this
patch just removes extraneous function calls and code in
User::getOption() and User::setOption(). It also adds
unit tests for user options (including a test for the
case provided in the bug report).
Change-Id: Idd8af9cf1a26a4adbde3ca71dde64539ecd0a207
Changeset Iec98e472 changed the behavior of action=parse&page=... when
passed a page that does not exist: previously, it would return a
"missingtitle" error instead of assuming an empty page. As some people
had been depending on this old behavior, restore the error checking.
Change-Id: I4c76ce458ceb01e233c6074cd9251879013ec143
WebKit's -webkit-image-set() requires a url() to work however css4-images'
version of image-set permits strings such that image-set( 'asdf.png' 1x ) would be permitted
and would bypass our filters.
Change-Id: I366d04807f66df449f791a5e8e2cb58768124a9a
UserTest::testEditCount did eleven calls to doEdit which is slow when
used with the sqlite backend. I have made to do less edits and also
marked it as '@group medium' which means the timeout will be 10 seconds
instead of 2 seconds.
Change-Id: If2d055075470f837009568d56b1119a57b177ba3
Syntax:
* Call parent setUp from setUp.
* Set required globals for the test inside the test class instead
of assuming the default settings.
* Data providers are called statically and outside setUp/tearDown
("public static function")
* Test function names should be prefixed with "test"
("testIsRedirect")
* Marked 2 functions as unused. JavascriptContentTest has 2 data
providers for tests that don't exist in it (nor in TextContentText)
but do exist in WikitextContentTest.
Style:
* Single quotes
* Remove odd comment "# =====" lines
* Consistent tree wrapping with arrays.
array(
array(
.. ) );
array(
array(
..
)
);
Some were closing on the previous line instead.
Made it consistent now.
* Remove odd indentation to make nested arrays line up:
array( 'foo' => array( 'bar' => true,
'baz' => array() ) )
array( 'foo' => array(
'bar' => true,
'baz' => array()
) )
We don't do this kind of indentation because it is fragile
and becomes outdates when any of the earlier keys ("foo")
change. Converted to a regular tree instead.
Also triggered git warnings for mixing spaces with tabs, which
is almost always an detector for this style.
* Not using @annotations in inline comments, reserved (and only
parsed/meaningful) for block comments.
Follows-up 8b568be5e2
Change-Id: Ic55d539b9a58f448b550bcd98894d389764e0694
Looks like someone messed with RequestContext when I wasn't looking at it.
WikiPage is a representation of the Title. It should not be possible for wikipage
to point to a different title than the context's title.
Fix this issue by unsetting WikiPage when setting title and updating title when
setting wikipage.
Change-Id: I40471b12d08763cb1b47b8382f96d8db94b4f319