Commit graph

92 commits

Author SHA1 Message Date
Moritz Schubotz (physikerwelt) ba19b3e1cd Implement wikidata entity selector
The current wikidata entity selector requires WikibaseRepo to be enabled on the client wiki, which is only the case for very small installations.

We implement our custom entity selector that
* displays the item label and
* uses the description as tool-tip.

The implementation was inspired by
mw.widgets.TitleInputWidget.

Bug: T229939
Change-Id: I35d6cc317cf2984d9de6e062f79030f5c31c0811
2020-12-19 09:11:40 +01:00
Moritz Schubotz (physikerwelt) 31aa824cc9 Remove RESTbase check compatibility endpoint
Change-Id: I8c539e96519e0f23ed606403ed88370edde70764
2020-11-24 19:24:41 +01:00
libraryupgrader da3c9edb26 build: Updating mediawiki/mediawiki-phan-config to 0.10.4
Change-Id: I0476384b99c41102ddca5928fbb068c45c139d56
2020-11-20 12:50:55 +00:00
Umherirrender dc007663b2 Usage of Yoda conditions is not allowed; switch the expression order
Change-Id: I3e3ca5e380521b514062953d4aeb635793819e89
2020-11-19 22:34:09 +01:00
libraryupgrader ce88944fe5 build: Updating mediawiki/mediawiki-codesniffer to 33.0.0
The following sniffs are failing and were disabled:
* Generic.ControlStructures.DisallowYodaConditions.Found
* MediaWiki.Commenting.FunctionComment.ObjectTypeHintParam
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected
* MediaWiki.Usage.ExtendClassUsage.FunctionConfigUsage
* MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage

Additional changes:
* Dropped .inc files from .phpcs.xml (T200956).

Change-Id: I2a0a579219607d60c1557d4b700cdf810f07f538
2020-11-04 04:01:14 +00:00
jenkins-bot a1e4882543 Merge "Register refresh links hook" 2020-10-27 22:43:19 +00:00
Thiemo Kreuz 3bbf35531b Remove confusing doc from MathRestbaseInterface
Change-Id: I5220cd1f0af95e26308aaec5c976d16ec67cb70b
2020-10-05 10:35:07 +02:00
Moritz Schubotz (physikerwelt) 6f41c0887c Register refresh links hook
* register hook
 MathHooks::onMaintenanceRefreshLinksInit
 from MaintenanceRefreshLinksInit

Bug: T248551
Change-Id: I0607265df22da5ab26cfc4c8958e9502b0e31b12
2020-09-29 18:06:08 +02:00
DannyS712 3f16b9f1c2 Remove use of $wgUser in onMaintenanceRefreshLinksInit
For now, the hook handler isn't actually used (T248551) but
when it is at some point it shouldn't use $wgUser

Bug: T248550
Bug: T248551
Change-Id: I826e91411deb91bbd8c58147b32fda3f3e7ed6a8
2020-09-27 01:02:47 +00:00
DannyS712 caa51dc4c9 Remove fallback to $wgUser in MathHooks::onPageRenderingHash
$user is always set

Bug: T248550
Change-Id: Id5a0d271ae840dd2aee4f40b4b7e73ab24f7cf98
2020-09-21 21:22:22 +00:00
MarcoAurelio be3a3f427f i18n: Fix typo 'occured'
Bug: T201491
Change-Id: Idcaa4c1b42f62e2f001a336b4a1fbc7cba46b47f
2020-09-10 18:08:54 +01:00
Lucas Werkmeister 8e0655eb55 Update for namespace moves
Change-Id: Ib22c0d6fae533c1adc63bc0954292c8349e97de0
Depends-On: I2d94d99da811581e76830ae3533c836b22d990c2
2020-06-11 16:43:44 +02:00
Umherirrender 8ee257c4e9 Pass function name to HttpRequestFactory::create
Useful for logging
Replace deprecated MWHttpRequest::factory with service (since 1.32)

Change-Id: I1d952ee807970ab4ffb18db94314c4aa6a7a3ce4
2020-06-07 12:22:10 +02:00
Reedy 2c220ddabc Fix PSR12.Properties.ConstantVisibility.NotFound
Bug: T253169
Change-Id: I816b6d26471527137cbddd313cd432f0a37db891
2020-06-05 00:17:18 +00:00
Moritz Schubotz (physikerwelt) 7c41bc19f8 Add mathoid check endpoint to REST API
Expose the math checking service via the REST API.

Port the behaviour of the RESTbase check endpoint to a new endpoint
that uses the MediaWiki API.

* this endpoint does not (yet) provide actual rendering (only checking)
* consequently it does not supply the x-resource-location header

Bug: T252390
Change-Id: I28bcb9a925953062b43cd3481536784431edcd8a
2020-06-01 12:11:24 -07:00
jenkins-bot b07aefbd36 Merge "Parse messages in string context" 2020-05-28 16:52:16 +00:00
jenkins-bot 13453d7831 Merge "Add MathCheckerFactory Service" 2020-05-27 18:44:03 +00:00
Moritz Schubotz (physikerwelt) 707ad58598 Add MathCheckerFactory Service
Use WANObjectCache rather than genuine DB tables for greater
flexibility.

Note, this commit is the second step of Ifd89e2d9cb30fa15cc318f077b434207ed6b7214

Bug: T252390
Change-Id: Ifa7d943875f05088ef697a5a18ad292342a9b4ad
2020-05-27 07:29:49 +02:00
Umherirrender b0f6c21b8e Parse messages in string context
The current default for Message::__toString() is to parse, so this
keeps that behaviour unchanged.

Change-Id: Icf83608b031390126b5e8d29a5600d37589cf411
2020-05-24 17:11:57 +02:00
Tim Starling 7dff64f214 Use HttpRequestFactory::createMultiClient()
This allows it to respect the proposed limit on HTTP request timeout.

Bug: T245170
Depends-On: I8252f6c854b98059f4916d5460ea71cf4b580149
Change-Id: I1c3d96720709253ad15bb8528cdd132571de2e4e
2020-05-21 14:38:48 +10:00
Moritz Schubotz (physikerwelt) fc0faf18c3 Move checking code to a new namespace
Introduce new namespace \MediaWiki\Extension\Math\ and move checking
code to this new namespace.

Note, this commit is the first step of Ifd89e2d9cb30fa15cc318f077b434207ed6b7214

Bug: T252390, T187154
Change-Id: I8c93f4b21d4a72ef2d52d4774d69e4ef55d037ec
2020-05-12 21:26:45 +02:00
DannyS712 17b2ce0d2d Properly restrict SpecialMathStatus to those with purge rights
Bug: T252362
Change-Id: I98eabfbeda2fbef3c317c7bb6aaddf5595788f5c
2020-05-11 05:17:11 +00:00
Moritz Schubotz (physikerwelt) b2359d08a1 Suppress warning if mathoid-cli does not return PNG image
* Currently PHP issues a unspecific warning if mathoid-cli does not
return a PNG image.
* This change suppresses this warning.

Bug: T200493
Change-Id: Ice7d12ca9131d76fe233fd332e37484feaf79883
2020-05-01 19:49:25 +02:00
Moritz Schubotz (physikerwelt) 9dad688f44 Add tracking category for pages that use a deprecated LaTeX syntax
Discussions in the Wikimedia Math Community show that there is consensus
to deprecate the use of MediaWiki specific LaTeX macros that conflict
with LaTeX macros from commonly used packages.
In this change, we show the deprecation warnings generated by mathoid.

Bug: T197842
Change-Id: I24dbb446665fdc227d0e7342fdbf8829b4c1bda4
2020-03-30 21:56:58 +02:00
Thiemo Kreuz a429c8cc35 Fix escaping issues and a series of unrelated code cleanups
Actual changes:
* Let the special page accept the subpage parameter, e.g.
  [[Special:MathWikibase/Q6203]].
* Fix some of the message escaping issues in SpecialMathWikibase.
  Messages that are just plain text and not supposed to contain any
  parameters, wikitext, HTML, or something like this should be
  properly escaped, either via Html::rawElement( $msg->escaped() ) or
  better Html::element( $msg->plain ). The later approach is cheaper.

Other code cleanups that don't affect production:
* Reduce the amount of duplicate code in SpecialMathWikibase.
* Make use of the preg_match() return value.
* Remove default parameters from parent::__construct() call.
* Remove some auto-generated comments.
* Remove some comments that don't add new information, but just repeat
  what the code already says.
* Make use of PHPUnit's assertCount().

We can split this patch into smaller patches, if you prefer. This
should especially be done if one of the changes is controversial, to
not block the other changes. Please tell me.

Change-Id: I8c20014435af3d2ac9c7381fe5fd00b9fe49b2c2
2020-03-21 14:53:15 +00:00
DannyS712 f5d0db1707 Use lowercase for primitive type 'string'
Change-Id: I17b5256ee73d68f3b57801512abac05a5c0d0c03
2020-03-20 15:34:55 +00:00
Timo Tijhof f59757a338 Replace $wgContLanguageCode with $wgLanguageCode
$wgContLanguageCode has been an unconfigurable copy of $wgLanguageCode
since 2006 (MW 1.8).

Bug: T247674
Change-Id: I1d2ec1e63320086fdf9ab7c6321f949c99c1ab2a
2020-03-14 19:31:26 +00:00
Reedy 7345e85b26 Remove trailing : from log error messages
Change-Id: Ie11662d0e55f553917df7a869de4b8019a827ae8
2020-02-14 21:13:07 +00:00
Reedy 819881ad9c Stop using 'url' param when logging
Bug: T245306
Change-Id: I3ba196e01afe172a99d15abf654a630a3f3d219f
2020-02-14 21:13:00 +00:00
Reedy c3a2b12077 Fix some excessive indenting
Change-Id: Icbd2f1461cbff96ad984b23738fb056a6c25af23
2020-02-14 20:57:23 +00:00
Reedy d819311602 Add $snakNamespace parameter to ValueSnakRdfBuilder implementer
Bug: T243122
Change-Id: I9b7c3b9daa81069a5b5eb66271f2c732cefe313f
2020-01-18 14:06:43 +00:00
libraryupgrader 5018e51b29 build: Updating mediawiki/mediawiki-codesniffer to 29.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate

Change-Id: I57bb0f5bc4167ea4b4a50d666ad95c02fcc7d8c9
2020-01-14 22:01:54 +00:00
jenkins-bot 6f347e7b34 Merge "build: Updating mediawiki/mediawiki-phan-config to 0.9.0" 2020-01-11 00:39:01 +00:00
jenkins-bot 45e6751a3c Merge "Don't list Special:MathWikibase if the wikibase client isn't loaded" 2019-12-30 09:05:52 +00:00
libraryupgrader 863794c1dd build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Change-Id: Id4f976b7ec94e1d2be0421725733804f24dec2c5
2019-12-29 17:56:56 +00:00
DannyS712 cf906ea1bc Replace @return true|false with @return bool
Change-Id: If6111abcb2c17622e58189a8b7200fc9a49c7b84
2019-12-28 10:29:18 +00:00
DannyS712 8faab2c2a0 Don't list Special:MathWikibase if the wikibase client isn't loaded
Bug: T241507
Change-Id: I23f6e8e72afeb791b3709d423041c02b58eb0b4a
2019-12-28 09:06:47 +00:00
AndreG-P 4c56817ba3 Delete Math Wikibase API
Delete the unused wikibase API endpoint in Math extension.

Bug: T240458
Change-Id: I3e6b0cfd61e8be8c65e64f85945bca32a4ba6089
2019-12-13 00:23:53 +09:00
AndreG-P 157dff4422 Fix reverse logic in hasSite function Math extension
Fixes naming problem introduced in If7da0990a4fc1f8d8a70237dc19c7b2e67ec38cd

Change-Id: I2fd20b2e18c624d22a780dfd496afb129b1f55b9
2019-11-28 19:25:31 +09:00
jenkins-bot 3bb6faf6b0 Merge "Link Wikipedia Articles from Specialpage Math Formula Information" 2019-11-26 19:48:39 +00:00
AndreG-P 912866b976 Link Wikipedia Articles from Specialpage Math Formula Information
Linking math formula on the special page to their own page, if this
a page exists

Bug: T239099
Change-Id: If7da0990a4fc1f8d8a70237dc19c7b2e67ec38cd
2019-11-27 03:58:28 +09:00
Ammar Abdulhamid 4a207bb74a Declare $logger as a protected class variable
Bug: T186243
Change-Id: I263a711fc12993c6201ca71cd512be1f64c1eb38
2019-11-26 17:14:48 +00:00
Ammar Abdulhamid 457ea5822f Classes: Type hint $updater parameter in onLoadExtensionSchemaUpdates
Bug: T223939
Change-Id: Ibc0d87f8cd7cb6a6b0f72c8b5fd08da13b55483f
2019-11-25 16:34:40 +00:00
jenkins-bot 13053e0a9c Merge "Fix capitalization of HTML Class" 2019-11-15 22:33:46 +00:00
Moritz Schubotz (physikerwelt) 848168c3a1
Fix capitalization of HTML Class
* Replace HTML->Html

Introduced in Idd22057a88312bf1a1cb5546d0a6edca5678d80d

Change-Id: If44743507d6897fa7600a16fc2002443cc3a556e
2019-11-15 23:03:48 +01:00
AndreG-P 54518a4981 Delete Wikibase repository dependency in Math extension
With this commit, the Math extension only depends on WikibaseClient
and no longer on WikibaseRepo.

Bug: T208758
Change-Id: Iac8f2568e0da1a4aff4f4b22d124626c8ecca8eb
2019-11-16 01:30:12 +09:00
jenkins-bot a406f9eae3 Merge "Add special page and API endpoint that show information from math Wikibase items" 2019-11-15 12:45:34 +00:00
Marko Obrovac 796a02173d Minor: Only log the code and body of the response in case of error
Bug: T238344
Change-Id: Ibf769f9f4f52062a7914f257979f510c809cbe37
2019-11-14 17:18:36 +01:00
Moritz Schubotz (physikerwelt) 4a7bc3ee31 Add special page and API endpoint that show information from math Wikibase items
Add a special page and an API endpoint to fetch data from Wikibase
items with a given qID. The special page summarizes information from
Wikibase. The API endpoint allows to request the information
directly. Both, the API endpoint and the special page, fetch the data
from a new helper class for consistency.

Bug: T208758
Bug: T229939
Change-Id: Idd22057a88312bf1a1cb5546d0a6edca5678d80d
2019-11-14 23:42:35 +09:00
Umherirrender b2e2a7b1a2 build: Updating mediawiki/mediawiki-phan-config to 0.8.0
Bug: T235049
Change-Id: I202d0b41c217498b0697eb9237c9f18725b7224d
2019-11-04 19:44:47 +01:00