Commit graph

4 commits

Author SHA1 Message Date
Timo Tijhof 70ab71d6a3 phpcs: Resolve style violations
Change-Id: Ie5d4d84b8d7b6bc88e7a5a1559579e504dd1bd20
2013-05-16 15:31:25 +00:00
Timo Tijhof 942c88f749 API: Update/Normalise before outputting
I ran into countless random exceptions and errors locally due to
cache I built up over time that was no longer valid. Though in
approved commits in the repository there is only 1 version as of
now, I'm sure we will make changes in the future that require a
cache invalidation since getHtml needs to be able to make
assumptions about what properties exist.

Also fixed a bug in the parse() method where the 'deprecated'
property is asserted the wrong way around. Added a test for it.

Change-Id: I5f61d6030578a711909435c8b996373e9aaa5178
2013-04-23 23:52:37 +00:00
Timo Tijhof 30b4a592c6 API: Transform into a standalone module instead of a query submodule.
Change-Id: Ia858fa43a50ade947e6353d22dc89a519c3da61a
2013-03-30 01:53:39 +01:00
Timo Tijhof b7080c5f90 Initial TemplateData commit
Registers a parser tag <templatedata> that should have a JSON
blob as content. The blob is then validated and normalised when
MediaWiki parses the page (e.g. during save and preview).

If there are validation errors, the save is aborted from the
extension hook and an error is displayed.

If all goes well, the normalised blob is stored in the database
(which can be retrieved through the API). And an HTML
representation of the template parameters is returned to the
wikitext parser to show where the <templatedata> was in the page.

The blob format is specified in spec.templatedata.json and
is validated in TemplateDataBlob::parse.

Bug: 44444
Change-Id: Icf305892a9512545a63f5a5280cc0d340c61585f
2013-03-14 19:19:55 +00:00