Last modified: 2013-06-18 15:20:00 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31261, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29261 - Translate extension should use correct API hook
Translate extension should use correct API hook
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Translate (Other open bugs)
unspecified
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: ---


Attachments

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
Actually:
// 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 https://gerrit.wikimedia.org/r/#/c/7154/ 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.


Navigation
Links