On Aug 13, 2009, at 7:39 PM, Ludovic Dubost wrote:
YES ! We should update as much as possible and clearly we should update the parent.
This has caused me issues many times when working on some projects..
The fix should not actually be that difficult.. Is not in one query (this would not be compatible with future storage systems). But with "where doc.parent='...'" and then for (doc in search) { doc.setParent() doc.save() } That is not a too difficult fix for the renaming.
I'm not sure if we already have a jira for that.
we do: http://jira.xwiki.org/jira/browse/XWIKI-1082 -Vincent
Ludovic
Caleb James DeLisle a écrit :
Hello all, I noticed that when a document is renamed, it's "child" documents don't have their parent values updated. It looks like just a few lines of code, maybe an hql ALTER XWikiDocument doc WHERE doc.parent = '"+oldName+"' SET doc.parent = '"+newName+"'
Is this too messy? I think a loop with doc.doc.setParent(newName) and doc.save() would be too resource intensive with databases which fsync every transaction.
Should we bother to even ask the user the way it asks to update links?
Should we update #includeForm, #includeInContext, and #includeTopic as well?
What are your thoughts?
~Caleb James DeLisle I'm new here, let me know if I posted in the wrong section