MichaelBelgium / mybb_to_flarum

A Flarum extension to convert a mybb forum to a fresh flarum install
MIT License
26 stars 15 forks source link

fix bug import discussions without replies #5

Closed dshovchko closed 7 years ago

MichaelBelgium commented 7 years ago

Why +1? Comments are posts on a discussion without the original post Also lastpostnumber is not the count, its the number of the post and that always starts at 1

If you're saying this is wrong then it's MyBB fault but it's right either way

EDIT: I found an issue with last_post_number but the fix isn't = 0 at the start, needs $lastpostnumber - 1 at end EDIT2: to get more easier its just $trow["replies"] + 1 - no even need that variable

dshovchko commented 7 years ago

then I will offer this variant

MichaelBelgium commented 7 years ago

After some digging I agree there's an issue with comment count but the problem isn't in the database ...

For example if you look at this mybb post and this is in the mybb db: mybb db (http://puu.sh/vCdam.png)

It does have 3 replies. And it does have also in flarum: flarum db (http://puu.sh/vCdg5.png)

But in flarum it says 2 in the thread overview: flarum toverview (http://puu.sh/vCdhU.png)

while in mybb it does say 3: mybb toverview (http://puu.sh/vCdjy.png)

If you do +1 then posts without comments will be wrong

dshovchko commented 7 years ago

I have selected 3 discussions converted from mybb: id 1 has 0 replies id 11 has 1 reply id 121 has 2 replies

And created in flarum 3 discussions: id 131 has 0 replies id 132 has 1 reply id 133 has 2 replies

dshovchko commented 7 years ago

I have made it

MichaelBelgium commented 7 years ago

What does it say in the mybb database ? Id 1, 11 and 12 - replies

dshovchko commented 7 years ago

https://ibb.co/gjwk0k

dshovchko commented 7 years ago

I have added ORDER BY in query and changed setting comments_count and last_post_number

MichaelBelgium commented 7 years ago

Ok, I get the comments_count now, its not logical tho, but i'll commit/fix it myself as i added some stuff already

dshovchko commented 7 years ago

Ок