Last modified: 2010-05-15 15:48:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 8790 - $wgUseMetaDataEdit extension-ification
$wgUseMetaDataEdit extension-ification
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Marcus Schwartz
: patch, patch-need-review
Depends on:
  Show dependency treegraph
Reported: 2007-01-26 18:44 UTC by Marcus Schwartz
Modified: 2010-05-15 15:48 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Patch for metadataedit bugs (8.33 KB, patch)
2007-01-26 18:45 UTC, Marcus Schwartz
second rev of patch for metaedit bugs (8.44 KB, patch)
2007-01-27 22:29 UTC, Marcus Schwartz

Description Marcus Schwartz 2007-01-26 18:44:37 UTC
I have discovered a number of bugs in the $wgUseMetadataEdit code:

- "show changes" on the edit page does not include the metadata

- metadata edits can be lost or misordered during section edits
  - the current code will simply stuff the new/edited metadata into 
    the end of the section being edited, while leaving any existing
    metadata at the end of the article.

- the parser that extracts metadata appears to have a condition that
  can cause the loss of content from previous revisions.
  - i did not actually experience this bug, but in trying to understand 
    how the parser works, i discovered that it sometimes fails to 
    un-explode the content, which could in theory replace text with "Array"
    in the articles.  Look for the "$y = implode("]]", $y)" on line 70 of
    my patch.

- metadata ordering can change between normal edits, which makes
  history diffs messy.
  1. edit the page.  add a new whitelist metadata field to the 
     normal textbox.  save the page.  Note in the source of the new
     revision that your metadata is still in the middle of the article
  2. edit the page again.  add some new content in the normal textbox.
     save the page.  Note that the source of the new revision now has
     the metadata from step 1 located at the end of the text, rather
     than in the middle of it.

I believe that I have fixed these bugs, and I will attach the patch in
a moment.  The patch also includes two new hooks, which allow
an extension to replace both the metadata parser and the metadata 
textbox on the EditPage.  I believe that this patch will have zero 
impact on any installations that are not using $wgUseMetaDataEdit.
Comment 1 Marcus Schwartz 2007-01-26 18:45:33 UTC
Created attachment 3143 [details]
Patch for metadataedit bugs
Comment 2 Marcus Schwartz 2007-01-26 21:43:03 UTC
hashar on freenode #mediawiki made some comments about removing this code from
the mediawiki core entirely, and moving it into an extension.  I suppose this
makes sense, since I can't imagine that any major mediawiki installations are
using this anyway, given the bugs in it.

If this is preferable, I can put together a patch that removes all of this code
and replaces it with a handful of hooks, and then create a basic extension that
provides the same functionality.  

This would actually be preferable to me, as I am already building another
extension that provides more advanced metadata editing functionality, and this
would greatly improve the modularity/integration of that extension as well.
Comment 3 Marcus Schwartz 2007-01-27 22:29:11 UTC
Created attachment 3150 [details]
second rev of patch for metaedit bugs

There was still a section editing bug in the previous patch.
Comment 4 Marcus Schwartz 2007-02-01 06:03:27 UTC
per a freenode discussion with brion, I will prepare a patch that removes all
metadata edit code from the core, and an extension that replicates the
functionality (with the bugs fixed, I hope).  In the meantime, I am taking
ownership of this bug so that it doesn't clutter other people's lists.
Comment 5 Alexandre Emsenhuber [IAlex] 2010-02-20 17:13:26 UTC
Moved the code to the "MetadataEdit" extension in r62740.

I am closing this bug as FIXED and I just created bug 22594 in "MediaWiki extensions" product for the bugs you pointed out in comment #0 ("show changes on the edit page does not include the metadata" was fixed in r62740 though). Please provide a new patch for the fixes against the extension if you can.

Note You need to log in before you can comment on or make changes to this bug.