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

Can't deals with "Report handler"

Discussion in 'XenForo Development Discussions' started by account8226, May 8, 2013.

  1. account8226

    account8226 Guest

    Hello,

    I'm having problems with my report handler. I was able to set up a like handler for one content without any problems, but I can't get my report handler work on an other content.

    The problem is the following : my 'fields' column in 'xf_content_type' doesn't get filled up, it's stuck to 0 bytes even after I added a xf_content_field' row for this.

    Any ideas ?

    Kind regards.
     
  2. Dan

    Dan Well-Known Member

    Did you rebuild the content type cache?
    run the following code, which will fill the xf_content_type fields
    PHP:
    $this->getModelFromCache('XenForo_Model_ContentType')->rebuildContentTypeCache();
     
    account8226 likes this.
  3. account8226

    account8226 Guest

    I wanted to, but I don't find where is the option ?
     
  4. Dan

    Dan Well-Known Member

    There is none.

    This is happening "only" automatically while the addon installation & deinstallation.

    While the addon development, you need to do run this.
     
    account8226 likes this.
  5. account8226

    account8226 Guest

    Working like a charm, thanks you very much EL :) :D
     
  6. Dan

    Dan Well-Known Member

    If you need this often, i would suggest to create a own controller, to manage the fields^^
    Another simple solution would be just to extend the misc controller and add a additional action
    PHP:
    class ElDevtools_Extend_ControllerPublic_Misc extends
    XFCP_ElDevtools_Extend_ControllerPublic_Misc
    {
    public function 
    actionRebuildContainerAndCache()
    {
    $this->getModelFromCache('XenForo_Model_ContentType')->rebuildContentTypeCache();
    return 
    $this->responseMessage('..');
    }
    }
     
  7. account8226

    account8226 Guest

    Or a custom cron entry, that you would run manually ?
     
  8. Dan

    Dan Well-Known Member

    1. You'll still wouldn't be able to test it immediately because you would have to wait for the cron to run
    2. Overhead, because the data aren't changing often

    But if it would work for you, why not?:D
     
  9. account8226

    account8226 Guest

    There are loads of ways to do it ^^

    But for the cron entry I was thinking about a manual run, you can run a cron task without waiting, under the cron tab.

    Thanks for the help, I was stuck but it's reporting correctly now :)
     

Share This Page