mybb / merge-system

The MyBB Merge System allows for easy merging of an existing forum (be it MyBB or another forum software) into a MyBB 1.8.x forum.
Other
32 stars 33 forks source link

Fix some problems in the base posts module #225

Closed yuliu closed 5 years ago

yuliu commented 5 years ago
  1. In the cleanup() of the posts module, set the output header only if it's not been set, to avoid double headers appear.
  2. Still in the cleanup() of the posts module, fix the the internal progress indicator to make rebuild_thread_counters() working correctly.
euantorano commented 5 years ago

This looks good, I just need to give it a test run. Thanks for the contribution!

yuliu commented 5 years ago

I'm writing a converter for Discuz! forum, but an old version X2.5.

The first problem is not a big deal, but if a converter defined cleanup() has a header print before calling its parent's one, two headers exist. In the second one, the paginated query is not correctly counting. Only a portions of threads will be recount and rebuilt.

Edit to add: Sorry, I was so sleepy last night. I'm writing a converter for Discuz! X2.5 and have found these problems. Also the table integer field type checking of closed in the threads table should also be taken away. Maybe old MyBB 18xx use an integer to indicate a thread's open/close status, but later versions has moved thread info, so change this field into a text field.

I also found the causing of problematic encode_to_utf8() function. I should open an issue to discuss them and pull a request, too, later.

Thanks for the quick comment, @euantorano

euantorano commented 5 years ago

It would be great if you get a chance to open an issue for those problems @yuliu, thanks. If you don't get a chance, I'll open one.