Last modified: 2013-06-18 15:20:00 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.
I blame MediaWiki. I need to write two hooks to actually do anything useful.
Actually: // Check syntax for \<translate> $wgHooks['ArticleSave'][] = 'PageTranslationHooks::tpSyntaxCheck'; $wgHooks['EditFilterMerged'][] = 'PageTranslationHooks::tpSyntaxCheckForEditPage'; If the API can't handle that...
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?
(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.
Thanks for the clarification. I will look at that at some point.
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.
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.
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.