Last modified: 2013-06-18 15:20:00 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 29261 - Translate extension should use correct API hook
Translate extension should use correct API hook
Product: MediaWiki extensions
Classification: Unclassified
Translate (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Niklas Laxström
Depends on:
Blocks: 14261 noncoreapi
  Show dependency treegraph
Reported: 2011-06-03 14:01 UTC by Mark A. Hershberger
Modified: 2013-06-18 15:20 UTC (History)
2 users (show)

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


Description Mark A. Hershberger 2011-06-03 14:01:57 UTC
When creating a page via the API with unbalenced <translate> tags, I got this error:

  The server encountered an error: (hookaborted) The modification you tried to
  make was aborted by an extension hook

Looking through bugzilla, it looks like the Translate doesn't use the right hook.  See Bug #14261.
Comment 1 Niklas Laxström 2011-06-03 14:17:36 UTC
I blame MediaWiki. I need to write two hooks to actually do anything useful.
Comment 2 Niklas Laxström 2011-06-03 14:18:56 UTC
// Check syntax for \<translate>
$wgHooks['ArticleSave'][] = 'PageTranslationHooks::tpSyntaxCheck';
$wgHooks['EditFilterMerged'][] = 'PageTranslationHooks::tpSyntaxCheckForEditPage';

If the API can't handle that...
Comment 3 Niklas Laxström 2011-09-15 07:39:45 UTC
Roan: can you tell me whether it is my extension doing wrong, the API doing wrong or the current way of doing things just not good?
Comment 4 Roan Kattouw 2011-09-18 16:00:46 UTC
(In reply to comment #3)
> Roan: can you tell me whether it is my extension doing wrong, the API doing
> wrong or the current way of doing things just not good?
The current way of doing things sucks (more specifically, EditPage sucks), but there is a workaround that Translate could be using but isn't. You can use the APIEditBeforeSave hook to abort the edit and pass information back to the API client.
Comment 5 Niklas Laxström 2011-09-18 16:03:05 UTC
Thanks for the clarification. I will look at that at some point.
Comment 6 Niklas Laxström 2011-09-19 13:02:38 UTC
Using that hook doesn't actually do what I want. I can provide custom error, but I would need to change my editing interface to specifically handle that.
Comment 7 Niklas Laxström 2012-05-29 12:54:10 UTC
Roan did but we are also using EditFilterMerged hook which gets executed before ArticleSave, we still get hookaborted error because errors from that hook are not propagated.
Comment 8 Niklas Laxström 2012-10-10 14:21:43 UTC
I'm just gonna close this bug, since it depends on core changes which nobody is working on. Patches are welcome, but not a priority for us.

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