hello
I am trying to fix the bug that makes it hard to remove a forum from mmbob. What
goes wrong is clear, only why it goes wrong is a mystery to me.
When you remove a forum from mmbob it removes all forum content in a cascading
way:
forum
> forum posters
> forum post areas
> forum post threads
> forum postings
when you remove a poster or a posting, first all references to these nodes are
removed. the references exist in postarea, posttread and forum objects (for
poster also in posting.
So what goes wrong is that while removing all posters to a forum, for say poster
with id 104 a reference is found in postarea with id 107.
the 107 node is fetched, the 'lastposternumber is set to null, and the node is
committed. all good and well:
2007-01-15 14:21:10,824 DEBUG mmbase.applications.mmbob.Poster - going to
remove poster: 104
2007-01-15 14:21:10,852 DEBUG mmbase.applications.mmbob.Poster - found:
(postareas)
[c_lastpostsubject='post',viewcount='2',c_lastposter='een',c_lastposttime='1168447091',lastposternumber='104',owner='admin',postcount='2',updatetime='null',description='',state='null',postthreadcount='1',name='area',createtime='null',edittime='null',otype='63',lastpostnumber='113',number='107'[EMAIL PROTECTED]
2007-01-15 14:21:10,852 DEBUG mmbase.applications.mmbob.Poster - cloud id:
15470939
2007-01-15 14:21:10,852 DEBUG mmbase.applications.mmbob.Poster - just set the
value of field lastposternumber to null. it reads:
2007-01-15 14:21:10,887 DEBUG mmbase.applications.mmbob.Poster - ** test:
refetch this node and check the value:
c_lastpostsubject='post',_exists='null',viewcount='2',c_lastposter='een',c_lastposttime='1168447091',lastposternumber='null',owner='admin',postcount='2',updatetime='null',_number='null',description='',state='null',postthreadcount='1',edittime='null',createtime='null',name='area',otype='63',lastpostnumber='113',number='107'[EMAIL PROTECTED]
after committing and refetching the node the lastposternumber is set to null, as
it should be.
But then all forum postings are removed, and again all references are looked up.
Node 107 is found again, because it also has a reference to a posting (say node
111). So the procedure is the same, fetch the node, set the reference field to
null, and commit. But:
2007-01-15 14:21:11,469 DEBUG mmbase.applications.mmbob.Posting - going to
remove posting: 113
2007-01-15 14:21:11,485 DEBUG mmbase.applications.mmbob.Posting - found:
[c_lastpostsubject='removed',_exists='null',viewcount='2',c_lastposttime='1168447091',c_lastposter='een',owner='admin',lastposternumber='104',postcount='2',updatetime='null',description='',_number='U-6_107',state='null',postthreadcount='1',name='area',createtime='null',edittime='null',otype='63',number='107',lastpostnumber='113'[EMAIL PROTECTED]
2007-01-15 14:21:11,485 DEBUG mmbase.applications.mmbob.Posting - just set the
value of field lastpostnumber to null. but it reads:
2007-01-15 14:21:11,485 DEBUG mmbase.applications.mmbob.Posting - cloud id:
15470939
2007-01-15 14:21:11,519 ERROR applications.mmbob.gui.Controller - node
107[c_lastpostsubject, lastposternumber, lastpostnumber], builder 'postareas'
[field 'lastposternumber' with value '104': The value '104' is not a valid node
value]
java.lang.IllegalArgumentException: node 107[c_lastpostsubject,
lastposternumber, lastpostnumber], builder 'postareas' [field 'lastposternumber'
with value '104': The value '104' is not a valid node value]
at org.mmbase.bridge.implementation.BasicNode.commit(BasicNode.java:490)
at
org.mmbase.applications.mmbob.Posting.removeForeignKeys(Posting.java:294)
at org.mmbase.applications.mmbob.Posting.remove(Posting.java:274)
at org.mmbase.applications.mmbob.PostThread.remove(PostThread.java:572)
at org.mmbase.applications.mmbob.PostArea.remove(PostArea.java:864)
at org.mmbase.applications.mmbob.Forum.remove(Forum.java:1098)
at
org.mmbase.applications.mmbob.ForumManager.removeForum(ForumManager.java:175)
at
org.mmbase.applications.mmbob.gui.Controller.removeForum(Controller.java:2437)
When node 107 is committed something goes wrong: the value we have just set to
null for the removal of the poster is back! 104! And it is not a valid value,
because the node is no longer around. how sad!
So, somehow the committed value is lost. What I notice and am not shure what it
means is fields like '_exists=null' or all the fields that start with 'c_'
Could they have something to do with it?
I did check cloud hash codes, and they are the same. also when I lookup node 107
in the editor the lastposternumber is empty, as you should expect.
does anybody have any ideas at all? It would be nice, because i'm out at the
moment.
thanks,
Ernst
Perhaps they point towards the cause of this problem.
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers