[MGNLFORUM-75] Forum with thread can't be activated Created: 11/Feb/09  Updated: 04/Nov/15  Resolved: 04/Nov/15

Status: Closed
Project: Forum (closed)
Component/s: None
Affects Version/s: None
Fix Version/s: 1.3.x

Type: Bug Priority: Major
Reporter: Jan Haderka Assignee: Unassigned
Resolution: Won't Do Votes: 2
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File stacktrace.txt    
Issue Links:
causality
relation
is related to MGNLFORUM-77 Thread can't be deleted Closed
supersession
is superseded by MGNLFORUM-139 Use weak-references for first/lastMes... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Most likely caused by references between thread and first message.



 Comments   
Comment by Philipp Bracher [ 12/Feb/09 ]

We can't activate references and should consequently not use them at all.

Comment by Magnolia International [ 12/Feb/09 ]

Since the references are "contained" (i.e the references here are under the thread nodes we're trying to activate), wouldn't changing the "rule" work? (i.e activate thread and messages subnodes of the forum node as one item of the activation instead of multiple)

Comment by Jan Haderka [ 29/Jul/09 ]

Yes changing the rule to activate forum with all the subcontent together as one activation item would work.

Comment by Magnolia International [ 12/Jan/11 ]

If using versioning, a custom version command could help (override VersionCommand#getFilter()). If not, it's a little trickier, but dms does it too, with info.magnolia.module.dms.DMSAdminTree#getCommandContext. See also the data module, which has similar workarounds.

A simple rule would not really help, in that it would then activate all messages of a forum/thread, while ideally, we only want to activate the first one.

To be considered: what to do with the "lastMessage" property ? Activate the message (not so good), change the value to make it point to the first message? Make the property non-mandatory, so we can activate without it, and rework the ForumManager so that it's able to reset the property if needed ? Remove the property altogether and use a cache mechanism to keep those values up-to-date?

Comment by Jan Haderka [ 14/Jan/11 ]

Actually the issue is even more complex. While changing the tree to activate all the threads and all messages together with the forum allows activation to proceed for the first time, the same approach doesn't work for updates. During updates transactional activation needs to make a backup of the content prior to update and this mean that even such update will need to include all the content in a bulk and not atomically piece by piece. This is not possible with current activation. The only options for fixing this is rewriting activation or changing references in forum to weak references or removing them all together (and using string same way as everywhere else).

Comment by Magnolia International [ 17/Jan/11 ]

MGNLFORUM-139 proposes to use weak-references, but 1) this is not possible with JCR 1.0 (which forum 1.3 still depends on), 2) it brings a whole other set of issues because we need to handle "missing" references, one way or another.

What if transactional activation is not used ?

Comment by Javier Linares [ 29/Mar/11 ]

Hi,

The fix provided (http://nexus.magnolia-cms.com/content/repositories/magnolia.public.snapshots/info/magnolia/magnolia-module-forum/1.3-SNAPSHOT/magnolia-module-forum-1.3-20110118.110316-23.jar

doesn't seem to work. I am running Magnolia CE 4.3.8 without magnolia-module-exchange-transactional-1.1.2.jar. I am getting the following error when trying to activate the threads from the adminCentral in the author instance: "can't version: Target node 028d0956-4dba-443f-bcf9-638807028468 of REFERENCE property does not exist" & the following stacktrace:

2011-03-29 17:06:16,899 ERROR info.magnolia.cms.core.version.BaseVersionManager : failed to copy versionable node to version store, reverting all changes made i
2011-03-29 17:06:16,899 ERROR olia.module.admininterface.commands.VersionCommand: can't version
javax.jcr.ReferentialIntegrityException: Target node 028d0956-4dba-443f-bcf9-638807028468 of REFERENCE property does not exist
at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.checkReferentialIntegrity(SharedItemStateManager.java:1076)
at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:577)
at org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:1130)
at org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:1160)
at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:351)
at org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:354)

Can it be a problem with my environment?
Thanks

Comment by Magnolia International [ 18/Apr/11 ]

Hard to say - can you run a query on your author instance a see what 028d0956-4dba-443f-bcf9-638807028468 corresponds to ?
In the query tool, select the "forum" workspace and run this query: SELECT * FROM nt:base WHERE jcr:uuid='028d0956-4dba-443f-bcf9-638807028468'

Comment by Javier Linares [ 04/May/11 ]

Hello,

The query returns

1 nodes returned in 0ms
/pagecomments/demo/2011-05-04-15-56-0

where demo is the name of the thread I'm trying to activate.

When I try to activate the first node in the forum menu ("Page comments"), I get the following error:

no definition found in parent node's node type for new node: no matching child node definition found for

{http://www.magnolia.info/jcr/mgnl}

versionMetaData: no matching child node definition found for

{http://www.magnolia.info/jcr/mgnl}

versionMetaData

With this stacktrace.

javax.jcr.nodetype.ConstraintViolationException: no matching child node definition found for

{http://www.magnolia.info/jcr/mgnl}

versionMetaData
at org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicableChildNodeDef(EffectiveNodeType.java:732)
at org.apache.jackrabbit.core.NodeImpl.getApplicableChildNodeDefinition(NodeImpl.java:886)
at org.apache.jackrabbit.core.NodeImpl.internalAddChildNode(NodeImpl.java:771)
at org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:741)
at org.apache.jackrabbit.core.NodeImpl.addNodeWithUuid(NodeImpl.java:2223)
at org.apache.jackrabbit.core.NodeImpl.addNode(NodeImpl.java:2178)
at info.magnolia.cms.core.DefaultContent.<init>(DefaultContent.java:159)
at info.magnolia.cms.core.DefaultContent.createContent(DefaultContent.java:194)
at info.magnolia.cms.core.AbstractContent.createContent(AbstractContent.java:74)
at info.magnolia.cms.core.version.BaseVersionManager.getSystemNode(BaseVersionManager.java:481)
at info.magnolia.cms.core.version.BaseVersionManager.createVersion(BaseVersionManager.java:194)
at info.magnolia.cms.core.version.BaseVersionManager.addVersion(BaseVersionManager.java:162)
at info.magnolia.cms.core.DefaultContent.addVersion(DefaultContent.java:477)

Once I get this error, If I try to activate a thread, I always get this later message.

Thanks,
Javier

Comment by Jan Haderka [ 04/Jul/11 ]

since the previously made changes are just a workaround and working only in specific case, rollback this change and attach is as a patch to this issue.

Comment by Michael Mühlebach [ 04/Nov/15 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

Generated at Mon Feb 12 02:00:28 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.