zikula-modules / DizkusModule

Official repository for Dizkus, a fully integrated forum solution for Zikula 1.4+
21 stars 7 forks source link

Forum tree manager and data synchronisation #324

Open Kaik opened 7 years ago

Kaik commented 7 years ago

Forum tree management needs to be recreated. Dizkus current "Recalculate..." function is not efficient. Recalculating big forum end with a timeout. So I decided I will create dedicated admin page with jstree and tree walker so synchronization can be done in small steps. This page will be as well prototype for new full ajax admin forum tree management.

Todo:

There are three sync areas which are connected to each other. The base for everything is topic and its posts it is a source of information for two other areas users and forum tree. Users area is kind of independent of the topic (topic does not need to be synced to sync users) because users and posts are connected directly. Forum sync relays on accurate topic data so last post and posts/reply count (postCount = replyCount + 1) and on accurate sub-forums data postCount topicCount last post.

Sync is called:

Normal sync - I think I will use events to handle this. Add post example: User is adding post after it is done sync topic is called which is handling topic sync (reply count last post it) - I still do not know details of it, topic sync event might not be needed it might be done "internally" by topic (maybe doctrine events etc). User post/topic count need to be updated this might not need an event as well but we will see. Forums up to the top need to be updated with posts/topics counts and last post and here I think event which is calling itself for parent will/might be a proper solution.

Admin "full sync" page will be divided into 3 parts:

Additionally I want to make it ajax and non ajax*(I might abandon non ajax sync at some point). Most probably during the full sync forum will be disabled for maintenance - syncing big forums will take some time so it is needed to prevent any user-forum interactions during syncing.

Forum:

Topic:

Post: ... no sync needed

User:

Kaik commented 6 years ago

So below is the current stage of "new" forum manager view - this is non ajax and ajax view. It is compatible with js tree and I'm working on both ajax/no-script-ajax versions. ~I will add more info there like post topic counts etc and much more...~

Things can get corrupted (after import or just during site errors, crash etc...). There is Tree structure corruption and forum data "corruption" - last post - posts - topics etc.. For structure I will use doctrine to detect and then fix it while for forum data sync functionality is needed.

screencapture-core15-desktop-local-dizkus-forum-tree-1507359826399

screencapture-core15-desktop-local-dizkus-forum-tree-1507359921337

Kaik commented 6 years ago

Additionally, all forum admin functions were moved to forum controller for consistency.

Kaik commented 6 years ago

I was able to move sync related activities to one class and already implemented basic sync - incrementing, last post etc.