Following up. 

I did some tests on some Special Page extensions I wrote based on the updated 
documentation at mediawiki.org <http://mediawiki.org/>. Here they are, in case 
anyone is interested. Both work, so the HTMLform callback is NOT the problem.

https://github.com/jimhu-tamu/scratch/tree/master/SpecialPageTests 
<https://github.com/jimhu-tamu/scratch/tree/master/SpecialPageTests>

Since then, I have a new hypothesis about what is happening and am wondering if 
someone here can clarify if this is correct or not.

The code is throwing the mass commit error only if something interrupts 
processing before execution is complete - that includes my testing with die() 
statements or other errors that I’ve been tracking down. So it seems like doing 
execution via the Special page is caching all database interactions into some 
unknown number of transactions that never get committed until page execution 
makes it all the way to the end. If it doesn’t, the mass commit error happens.

It looks to me like in the earlier versions of MW creating a page is committed 
during execution, so one can pull a revision for that page and do stuff to it 
in the same pass through the special page execution. Now it’s acting like there 
is not revision to pull after doing WikiPage::doEditContent(). When I comment 
out the right blocks of code, I can  see that I create the desired page from my 
template, but my attempt to pull the revision text back out and do something to 
it blanks the page and causes errors from code that expects there to be text in 
the revision.

I think I can find the problems now or do a different kind of workaround. But 
I’m curious if I’m right about the transactions and uncommitted page creation.

Thanks

Jim



> On Apr 23, 2019, at 11:15 AM, Jim Hu <jim.hu.bio...@gmail.com> wrote:
> 
> It’s a custom extension used by my lab only, and while a version is on our 
> public github, it’s going to be hard to follow because of entanglement with 
> some other custom code libraries we use that wrap the WikiPage class to 
> accommodate our use of the TableEdit extension. If you want to look anyway, 
> it’s here:
> 
> https://github.com/microbialphenotypes/OMPwiki/blob/master/OMP/specialpages/StrainSpecialPage/SpecialNewPage.php
> 
> But it would probably be more useful for you to wait until I can pare it down 
> to something that is minimal to see if I can isolate the problematic part and 
> then push that to github.
> 
> I was hoping someone had seen a similar problem with Special page development 
> and had a simpler answer!
> 
> Thanks!
> 
> Jim
> 
>> On Apr 23, 2019, at 10:29 AM, Jaime Crespo <jcre...@wikimedia.org> wrote:
>> 
>>>> For one of our custom wikis we have a Special Page that creates new pages
>>>> based on form input. This used to work in MW1.23 but in the long overdue
>>>> update to MW1.31 it stopped working.
>> 
>> I am not familiar with Special:StrainNewPage, I am guessing that is
>> custom code not available from a standard extension? If it is not
>> private and you could share that custom code (or at least part of it)
>> maybe someone can help you better to see what is the problem in your
>> case. :-)
>> 
>> _______________________________________________
>> Wikitech-l mailing list
>> Wikitech-l@lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> 

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to