• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RM 1.1 No button to discussion thread

GliX

Active member
#1
When I post a resource I don't see the discussion button for it. Although topic in the right forum is created, but there are no resource-related buttons in topic. I can not understand why this happened, because in older topics and resources all ok.

RM 1.1.4 with no addons related to it.
XF 1.4.2.

I found this code in template:
PHP:
    <xen:if is="{$thread}"><a class="callToAction" href="{xen:link threads, $thread}"><span>
        {xen:phrase discuss_this_resource}
        <xen:if is="{$thread.reply_count}"><small class="minorText">{xen:phrase replies}: {xen:number $thread.reply_count}, {xen:phrase latest}: {xen:datetime $thread.last_post_date}</small></xen:if>
    </span></a></xen:if>
How can i var_dump $thread to search for the causes of the problem?
 

GliX

Active member
#2
In database (xf_resouce table) - field discussion_thread_id is 0 for problem resouces.

No related addons for this field too:
Code:
root@***:~# grep -rl discussion_thread_id /var/www/main/data/www/***.me/library/
/var/www/main/data/www/***.me/library/XenResource/DataWriter/Resource.php
/var/www/main/data/www/***.me/library/XenResource/DataWriter/Update.php
/var/www/main/data/www/***.me/library/XenResource/Install/Controller.php
/var/www/main/data/www/***.me/library/XenResource/Model/Resource.php
/var/www/main/data/www/***.me/library/XenResource/ControllerPublic/Resource.php
root@***:~#
 

GliX

Active member
#6
Thanks @Brogan managed to solve the problem. Problem was in addon, which records in a specific table id's of all the posted threads.

Code of that addon:

PHP:
<?php

class DAPFYandexSearch_DataWriter_Discussion_Thread extends XFCP_DAPFYandexSearch_DataWriter_Discussion_Thread
{
    public function save()
    {
        parent::save();
        $thread = $this->getMergedData();
        $db = XenForo_Application::get('db');

        $data['thread_id'] = $thread['thread_id'];
        $data['date'] = time();

        $db->insert('xf_yandex_search_ping', $data);
    }
}
 

MattH

Active member
#8
To follow up, this has been resolved via ticket.
Hi Brogan,

I'm having a similar issue, but only with one resource... others have a discussion thread, but this one does not. I had previously used tabs by @Waindigo but removed that add-on, and can't figure out why the discuss resource button has now vanished just for one item?