<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Bug in wpForo Cross Posting — new topic created instead of linking to existing topic - wpForo Blog Cross Posting				            </title>
            <link>https://gvectors.com/forum/wpforo-blog-cross-posting/bug-in-wpforo-cross-posting-new-topic-created-instead-of-linking-to-existing-topic/</link>
            <description>WordPress Plugins Support Forum</description>
            <language>en-US</language>
            <lastBuildDate>Sun, 19 Apr 2026 21:21:10 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Bug in wpForo Cross Posting — new topic created instead of linking to existing topic</title>
                        <link>https://gvectors.com/forum/wpforo-blog-cross-posting/bug-in-wpforo-cross-posting-new-topic-created-instead-of-linking-to-existing-topic/#post-42416</link>
                        <pubDate>Tue, 11 Nov 2025 10:01:53 +0000</pubDate>
                        <description><![CDATA[@tennis2table 
Please provide us with a detailed list of the steps you’ve taken, so we can try to replicate the issue on our test websites for further investigation.At the moment, we’re una...]]></description>
                        <content:encoded><![CDATA[<p>@tennis2table </p>
<p>Please provide us with a detailed list of the steps you’ve taken, so we can try to replicate the issue on our test websites for further investigation.<br /><br />At the moment, we’re unable to reproduce the same issue on our end.</p>]]></content:encoded>
						                            <category domain="https://gvectors.com/forum/wpforo-blog-cross-posting/">wpForo Blog Cross Posting</category>                        <dc:creator>Astghik</dc:creator>
                        <guid isPermaLink="true">https://gvectors.com/forum/wpforo-blog-cross-posting/bug-in-wpforo-cross-posting-new-topic-created-instead-of-linking-to-existing-topic/#post-42416</guid>
                    </item>
				                    <item>
                        <title>RE: Bug in wpForo Cross Posting — new topic created instead of linking to existing topic</title>
                        <link>https://gvectors.com/forum/wpforo-blog-cross-posting/bug-in-wpforo-cross-posting-new-topic-created-instead-of-linking-to-existing-topic/#post-42402</link>
                        <pubDate>Fri, 07 Nov 2025 12:30:15 +0000</pubDate>
                        <description><![CDATA[Hello,

















After updating wpForo Cross Posting, the forum topic linked to a post is not detected automatically. I patched the code to make detection work and c...]]></description>
                        <content:encoded><![CDATA[<div class="draggable h-header-height bg-token-bg-primary sticky top-0 z-10 flex items-center border-transparent px-2 md:hidden print:hidden ">
<div class="no-draggable flex-1">
<div class="flex items-center">
<div>Hello,</div>
</div>
</div>
</div>
<main id="main" class="transition-width relative h-full w-full flex-1 overflow-auto -translate-y- pt-">
<div id="thread" class="group/thread @container/thread h-full w-full">
<div class="composer-parent flex flex-col focus-visible:outline-0 overflow-hidden h-full" role="presentation">
<div class="relative basis-auto flex-col -mb-(--composer-overlap-px)  grow flex overflow-hidden">
<div class="relative h-full">
<div class="flex h-full flex-col overflow-y-auto thread-xl:pt-(--header-height) ">
<div class="flex flex-col text-sm thread-xl:pt-header-height keyboard-open:pb- pb-25">
<article class="text-token-text-primary w-full focus:outline-none  has-data-writing-block:pointer-events-none has-data-writing-block:-mt-(--shadow-height) has-data-writing-block:pt-(--shadow-height) [&amp;:has()&gt;*]:pointer-events-auto  supports-: scroll-mt-" dir="auto" data-turn-id="405854bd-4ea8-466f-b47f-b6f816db6aaf" data-testid="conversation-turn-2" data-scroll-anchor="true" data-turn="assistant">
<div class="text-base my-auto mx-auto pb-10  thread-sm: thread-lg: px-(--thread-content-margin)">
<div class=" thread-lg: mx-auto max-w-(--thread-content-max-width) flex-1 group/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn">
<div class="flex max-w-full flex-col grow">
<div class="min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal :mt-1" dir="auto" data-message-author-role="assistant" data-message-id="dc074738-212d-419c-9229-c276146198d8" data-message-model-slug="gpt-5-thinking">
<div class="flex w-full flex-col gap-1 empty:hidden first:pt-">
<div class="markdown prose dark:prose-invert w-full break-words light markdown-new-styling">
<p data-start="952" data-end="1136">After updating<span> </span><strong data-start="967" data-end="991">wpForo Cross Posting</strong>, the forum topic linked to a post is not detected automatically. I patched the code to make detection work and can share the diff if you’d like.</p>
<p data-start="1138" data-end="1456">Second issue: the initial import of forum replies into WordPress comments works, but<span> </span><strong data-start="1223" data-end="1250">ongoing synchronization</strong><span> </span>only pulls<span> </span><strong data-start="1262" data-end="1279">administrator</strong><span> </span>replies. Replies from other user roles are ignored. I suspect a<span> </span><strong data-start="1344" data-end="1372">capabilities/permissions</strong><span> </span>check, but I’m not sure where to look (hook, filter, or role check) in your add-on.</p>
<p data-start="1458" data-end="1652">Have you seen this before? Could you point me to the part that handles permission checks for syncing (e.g., role checks,<span> </span><code data-start="1579" data-end="1597">current_user_can</code>, etc.)?<br data-start="1605" data-end="1608" />I can provide the patch and logs if helpful.</p>
<p data-start="1654" data-end="1687" data-is-last-node="" data-is-only-node="">Thanks for your support,</p>
</div>
</div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</div>
</div>
</div>
</div>
</main>]]></content:encoded>
						                            <category domain="https://gvectors.com/forum/wpforo-blog-cross-posting/">wpForo Blog Cross Posting</category>                        <dc:creator>Tennis2table</dc:creator>
                        <guid isPermaLink="true">https://gvectors.com/forum/wpforo-blog-cross-posting/bug-in-wpforo-cross-posting-new-topic-created-instead-of-linking-to-existing-topic/#post-42402</guid>
                    </item>
				                    <item>
                        <title>RE: Bug in wpForo Cross Posting — new topic created instead of linking to existing topic</title>
                        <link>https://gvectors.com/forum/wpforo-blog-cross-posting/bug-in-wpforo-cross-posting-new-topic-created-instead-of-linking-to-existing-topic/#post-42381</link>
                        <pubDate>Sat, 01 Nov 2025 11:38:48 +0000</pubDate>
                        <description><![CDATA[Please update the addon to the latest version, delete all kinds of caches and check again.
The issue should be solved]]></description>
                        <content:encoded><![CDATA[<p>Please update the addon to the latest version, delete all kinds of caches and check again.</p>
<p>The issue should be solved </p>]]></content:encoded>
						                            <category domain="https://gvectors.com/forum/wpforo-blog-cross-posting/">wpForo Blog Cross Posting</category>                        <dc:creator>Astghik</dc:creator>
                        <guid isPermaLink="true">https://gvectors.com/forum/wpforo-blog-cross-posting/bug-in-wpforo-cross-posting-new-topic-created-instead-of-linking-to-existing-topic/#post-42381</guid>
                    </item>
				                    <item>
                        <title>Bug in wpForo Cross Posting — new topic created instead of linking to existing topic</title>
                        <link>https://gvectors.com/forum/wpforo-blog-cross-posting/bug-in-wpforo-cross-posting-new-topic-created-instead-of-linking-to-existing-topic/#post-42380</link>
                        <pubDate>Sat, 01 Nov 2025 10:12:20 +0000</pubDate>
                        <description><![CDATA[Hello,
We’ve identified a bug in wpForo Cross Posting that causes a new topic to be created instead of linking a post to an existing topic when a topicid is manually entered in the post edi...]]></description>
                        <content:encoded><![CDATA[<p data-start="3192" data-end="3198">Hello,</p>
<p data-start="3200" data-end="3400">We’ve identified a bug in<span> </span><strong data-start="3226" data-end="3250">wpForo Cross Posting</strong><span> </span>that causes a<span> </span><strong data-start="3265" data-end="3278">new topic</strong><span> </span>to be created instead of<span> </span><strong data-start="3304" data-end="3315">linking</strong><span> </span>a post to an existing topic when a<span> </span><em data-start="3351" data-end="3360">topicid</em><span> </span>is manually entered in the post editor.</p>
<h3 data-start="3402" data-end="3413">Symptom</h3>
<ul data-start="3414" data-end="3610">
<li data-start="3414" data-end="3517">
<p data-start="3416" data-end="3517"><strong data-start="3416" data-end="3428">Expected</strong>: when an existing<span> </span><em data-start="3447" data-end="3456">topicid</em><span> </span>(e.g., 7955) is entered, the post should link to that topic.</p>
</li>
<li data-start="3518" data-end="3610">
<p data-start="3520" data-end="3610"><strong data-start="3520" data-end="3530">Actual</strong>: a<span> </span><strong data-start="3534" data-end="3547">new topic</strong><span> </span>is created (e.g., 8133), and the post links to this new topic.</p>
</li>
</ul>
<h3 data-start="3612" data-end="3669">Root cause 1 — Meta key mismatch (missing underscore)</h3>
<p data-start="3670" data-end="3963">The code<span> </span><strong data-start="3679" data-end="3688">reads</strong><span> </span>the meta with an underscore before the prefix (<code data-start="3736" data-end="3772">'_' . $prefix . META_POST_TOPIC_ID</code>) but<span> </span><strong data-start="3778" data-end="3788">writes</strong><span> </span>it without the underscore (<code data-start="3816" data-end="3846">$prefix . META_POST_TOPIC_ID</code>).<br data-start="3848" data-end="3851" />As a result, the stored<span> </span><em data-start="3875" data-end="3884">topicid</em><span> </span>is never read back, the mapping appears “missing,” and a new topic is created.</p>
<p data-start="3965" data-end="3992"><strong data-start="3965" data-end="3992">Minimal fix (examples):</strong></p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-php"><span><span class="hljs-comment">// BEFORE (write without underscore) <img class="emoji" role="img" src="https://s.w.org/images/core/emoji/16.0.1/svg/274c.svg" alt="&#x274c;" /></span><br /><span class="hljs-title function_ invoke__">update_post_meta</span>(<span class="hljs-variable">$postID</span>, <span class="hljs-variable">$prefix</span> . wp<span class="hljs-title class_">ForoCrossPostingOptions</span>::<span class="hljs-variable constant_">META_POST_TOPIC_ID</span>, <span class="hljs-variable">$topicID</span>);</span></code>
<p>&nbsp;</p>
<p><code class="whitespace-pre! language-php"><span class="hljs-comment">// AFTER (consistent with reads)<span> </span><img class="emoji" role="img" src="https://s.w.org/images/core/emoji/16.0.1/svg/2705.svg" alt="&#x2705;" /></span><br /><span class="hljs-title function_ invoke__">update_post_meta</span>(<span class="hljs-variable">$postID</span>,<span> </span><span class="hljs-string">'_'</span><span> </span>.<span> </span><span class="hljs-variable">$prefix</span><span> </span>. wp<span class="hljs-title class_">ForoCrossPostingOptions</span>::<span class="hljs-variable constant_">META_POST_TOPIC_ID</span>,<span> </span><span class="hljs-variable">$topicID</span>);<br /></code></p>
</div>
</div>
<p data-start="4273" data-end="4328">Apply similarly to the other related keys (forum/post):</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-php"><span><span class="hljs-title function_ invoke__">update_post_meta</span>(<span class="hljs-variable">$postID</span>, <span class="hljs-string">'_'</span> . <span class="hljs-variable">$prefix</span> . wp<span class="hljs-title class_">ForoCrossPostingOptions</span>::<span class="hljs-variable constant_">META_POST_FORUM_ID</span>, <span class="hljs-variable">$forumID</span>);<br /><span class="hljs-title function_ invoke__">update_post_meta</span>(<span class="hljs-variable">$postID</span>, <span class="hljs-string">'_'</span> . <span class="hljs-variable">$prefix</span> . wp<span class="hljs-title class_">ForoCrossPostingOptions</span>::<span class="hljs-variable constant_">META_POST_POST_ID</span>, <span class="hljs-variable">$firstPostID</span>);<br /></span></code></div>
</div>
<h3 data-start="4544" data-end="4614">Root cause 2 — User-entered<span> </span><em data-start="4576" data-end="4585">topicid</em><span> </span>is overwritten by empty meta</h3>
<p data-start="4615" data-end="4791">In the save routine, the<span> </span><em data-start="4640" data-end="4649">topicid</em><span> </span>from the form is read, but then it’s<span> </span><strong data-start="4687" data-end="4702">overwritten</strong><span> </span>by the meta value (which is empty on the first link), forcing the “create topic” branch.</p>
<p data-start="4793" data-end="4840"><strong data-start="4793" data-end="4840">Logical fix (honor the user-entered value):</strong></p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-php"><span><span class="hljs-comment">// After retrieving $topicID from $args:</span><br /><span class="hljs-keyword">if</span> (!<span class="hljs-keyword">empty</span>(<span class="hljs-variable">$topicID</span>)) {<br /><span class="hljs-variable">$topic</span> = <span class="hljs-title function_ invoke__">WPF</span>()-&gt;topic-&gt;<span class="hljs-title function_ invoke__">get_topic</span>((<span class="hljs-keyword">int</span>)<span class="hljs-variable">$topicID</span>);<br /><span class="hljs-keyword">if</span> (<span class="hljs-variable">$topic</span>) {<br /><span class="hljs-comment">// Persist immediately to the correct meta key (with underscore)</span><br /><span class="hljs-title function_ invoke__">update_post_meta</span>(<span class="hljs-variable">$postID</span>, <span class="hljs-string">'_'</span> . <span class="hljs-variable">$prefix</span> . wp<span class="hljs-title class_">ForoCrossPostingOptions</span>::<span class="hljs-variable constant_">META_POST_TOPIC_ID</span>, (<span class="hljs-keyword">int</span>)<span class="hljs-variable">$topicID</span>);<br /><span class="hljs-title function_ invoke__">update_post_meta</span>(<span class="hljs-variable">$postID</span>, <span class="hljs-string">'_'</span> . <span class="hljs-variable">$prefix</span> . wp<span class="hljs-title class_">ForoCrossPostingOptions</span>::<span class="hljs-variable constant_">META_POST_FORUM_ID</span>, (<span class="hljs-keyword">int</span>)<span class="hljs-variable">$topic</span>);<br />}<br />}</span></code>
<p>&nbsp;</p>
<p><code class="whitespace-pre! language-php"><span class="hljs-comment">// Then read from meta (now set)</span><br /><span class="hljs-variable">$topicID</span><span> </span>=<span> </span><span class="hljs-title function_ invoke__">get_post_meta</span>(<span class="hljs-variable">$postID</span>,<span> </span><span class="hljs-string">'_'</span><span> </span>.<span> </span><span class="hljs-variable">$prefix</span><span> </span>. wp<span class="hljs-title class_">ForoCrossPostingOptions</span>::<span class="hljs-variable constant_">META_POST_TOPIC_ID</span>,<span> </span><span class="hljs-literal">true</span>);<br /><span class="hljs-variable">$topic</span><span> </span>=<span> </span><span class="hljs-title function_ invoke__">WPF</span>()-&gt;topic-&gt;<span class="hljs-title function_ invoke__">get_topic</span>(<span class="hljs-variable">$topicID</span>);<br /></code></p>
</div>
</div>
<h3 data-start="5489" data-end="5500">Outcome</h3>
<ul data-start="5501" data-end="5657">
<li data-start="5501" data-end="5581">
<p data-start="5503" data-end="5581">Read/write use the<span> </span><strong data-start="5522" data-end="5539">same meta key</strong>, so the existing<span> </span><em data-start="5557" data-end="5566">topicid</em><span> </span>is recognized.</p>
</li>
<li data-start="5582" data-end="5657">
<p data-start="5584" data-end="5657">The user-entered<span> </span><em data-start="5601" data-end="5610">topicid</em><span> </span>is<span> </span><strong data-start="5614" data-end="5627">respected</strong>, preventing duplicate topics.</p>
</li>
</ul>
<p data-start="5659" data-end="5723">I can provide a precise patch/diff against your file if helpful.</p>
<p data-start="5725" data-end="5748">Many thanks in advance!</p>
<p data-start="5750" data-end="5789" data-is-last-node="" data-is-only-node="">Best regards,</p>]]></content:encoded>
						                            <category domain="https://gvectors.com/forum/wpforo-blog-cross-posting/">wpForo Blog Cross Posting</category>                        <dc:creator>Tennis2table</dc:creator>
                        <guid isPermaLink="true">https://gvectors.com/forum/wpforo-blog-cross-posting/bug-in-wpforo-cross-posting-new-topic-created-instead-of-linking-to-existing-topic/#post-42380</guid>
                    </item>
							        </channel>
        </rss>
		