1. This area is dedicated to the support of our xF2 add-ons, for support of our xF1 add-ons please use the dedicated forums.
    Note that we only accept support question and bug reports in this section.

    For suggestions, please wait until xF2 stable is released as we'll reorganize our forum at that time and accept them.
Dismiss Notice
We have just posted about our product policy for XF2.
Click HERE to view it.

Media Of The Month Fixed Contest thread not created

Discussion in 'Add-Ons Support' started by Nik, Sep 1, 2018.

  1. Nik

    Nik Member

    Joined:
    Dec 18, 2015
    Messages:
    53
    Likes Received:
    3
    @MtoR

    Setup a mode 2 contest with admin as the thread starter.


    • InvalidArgumentException: Attempted to convert NULL to string/binary [username]
    • src/XF/Mvc/Entity/Entity.php:688
    • Generated by: Unknown account
    • Aug 31, 2018 at 8:02 PM
    Stack trace
    #0 src/XF/Mvc/Entity/Entity.php(575): XF\Mvc\Entity\Entity->_castValueToType(NULL, 'username', 5, Array)
    #1 src/XF/Mvc/Entity/Entity.php(505): XF\Mvc\Entity\Entity->set('username', NULL)
    #2 src/XF/Service/Thread/Creator.php(105): XF\Mvc\Entity\Entity->__set('username', NULL)
    #3 src/XF/Service/Thread/Creator.php(69): XF\Service\Thread\Creator->setUser(Object(ForumApps\API\XF\Entity\User))
    #4 src/XF/Service/Thread/Creator.php(53): XF\Service\Thread\Creator->setupDefaults()
    #5 src/XF/Container.php(274): XF\Service\Thread\Creator->__construct(Object(XF\Pub\App), Object(ForumApps\API\XF\Entity\Forum))
    #6 src/XF/App.php(1359): XF\Container->createObject('XFA\\Core\\XF\\Ser...', Array)
    #7 src/XF/Container.php(228): XF\App->XF\{closure}('XFA\\Core\\XF\\Ser...', Array, Object(XF\Container))
    #8 src/XF/App.php(2508): XF\Container->create('service', 'XF:Thread\\Creat...', Array)
    #9 src/addons/XFA/XFMGMediaOfTheMonth/Service/Motm/ThreadNotifier.php(223): XF\App->service('XF:Thread\\Creat...', Object(ForumApps\API\XF\Entity\Forum))
    #10 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(247): XFA\XFMGMediaOfTheMonth\Service\Motm\ThreadNotifier->notify()
    #11 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(23): XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cronMode2()
    #12 [internal function]: XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cron(Object(XF\Entity\CronEntry))
    #13 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
    #14 src/XF/Job/Manager.php(241): XF\Job\Cron->run(7.9965128898621)
    #15 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9965128898621)
    #16 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.9965128898621)
    #17 job.php(15): XF\Job\Manager->runQueue(false, 8)
    #18 {main}

    -------------

    Previous InvalidArgumentException: Attempted to convert NULL to string/binary - src/XF/Mvc/Entity/ValueFormatter.php:104
    #0 src/XF/Mvc/Entity/Entity.php(684): XF\Mvc\Entity\ValueFormatter->castValueToType(NULL, 5, Array)
    #1 src/XF/Mvc/Entity/Entity.php(575): XF\Mvc\Entity\Entity->_castValueToType(NULL, 'username', 5, Array)
    #2 src/XF/Mvc/Entity/Entity.php(505): XF\Mvc\Entity\Entity->set('username', NULL)
    #3 src/XF/Service/Thread/Creator.php(105): XF\Mvc\Entity\Entity->__set('username', NULL)
    #4 src/XF/Service/Thread/Creator.php(69): XF\Service\Thread\Creator->setUser(Object(ForumApps\API\XF\Entity\User))
    #5 src/XF/Service/Thread/Creator.php(53): XF\Service\Thread\Creator->setupDefaults()
    #6 src/XF/Container.php(274): XF\Service\Thread\Creator->__construct(Object(XF\Pub\App), Object(ForumApps\API\XF\Entity\Forum))
    #7 src/XF/App.php(1359): XF\Container->createObject('XFA\\Core\\XF\\Ser...', Array)
    #8 src/XF/Container.php(228): XF\App->XF\{closure}('XFA\\Core\\XF\\Ser...', Array, Object(XF\Container))
    #9 src/XF/App.php(2508): XF\Container->create('service', 'XF:Thread\\Creat...', Array)
    #10 src/addons/XFA/XFMGMediaOfTheMonth/Service/Motm/ThreadNotifier.php(223): XF\App->service('XF:Thread\\Creat...', Object(ForumApps\API\XF\Entity\Forum))
    #11 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(247): XFA\XFMGMediaOfTheMonth\Service\Motm\ThreadNotifier->notify()
    #12 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(23): XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cronMode2()
    #13 [internal function]: XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cron(Object(XF\Entity\CronEntry))
    #14 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
    #15 src/XF/Job/Manager.php(241): XF\Job\Cron->run(7.9965128898621)
    #16 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9965128898621)
    #17 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.9965128898621)
    #18 job.php(15): XF\Job\Manager->runQueue(false, 8)
    #19 {main}
    Request state
    array(4) {
    ["url"] => string(8) "/job.php"
    ["referrer"] => string(77) "https://canadiancorvetteforums.com/threads/my-new-corvette-c6-z06-zr8x.20943/"
    ["_GET"] => array(0) {
    }
    ["_POST"] => array(0) {
    }
    }
     
    #1 Nik, Sep 1, 2018
    Last edited: Sep 1, 2018
  2. MtoR

    MtoR Freaky Coder
    Staff Member

    Joined:
    Nov 14, 2015
    Messages:
    4,302
    Likes Received:
    646
    Apparently the user doesn't exist.

    You had set this option ?
    Capture d’écran 2018-09-01 à 20.50.29.png
     
  3. Nik

    Nik Member

    Joined:
    Dec 18, 2015
    Messages:
    53
    Likes Received:
    3
    Yes of course. Set to user 1 who is admin
     
  4. MtoR

    MtoR Freaky Coder
    Staff Member

    Joined:
    Nov 14, 2015
    Messages:
    4,302
    Likes Received:
    646
    Ok right, found the issue.

    Will post a fix later tonight.
     
  5. Nik

    Nik Member

    Joined:
    Dec 18, 2015
    Messages:
    53
    Likes Received:
    3
    How can I manually retrigger the thread create now? Would re-running the cron do it?
     
  6. Terror

    Terror New Member

    Joined:
    Mar 6, 2016
    Messages:
    20
    Likes Received:
    0
    good evening, just updated to latest version, the cron run successfully now (manually started) :)

    but sadly no album or threads were created. our basic setup is:

    - mode 1
    - we created a gallery category for albums with videos only
    - user id is 13, but regular member, not administrator, can this be a problem?
    - start day 1 (which is today)

    best regards




    [edit] gave user id 13 full admin permissions, but still no album creation.
     
    #6 Terror, Sep 1, 2018
    Last edited: Sep 1, 2018
  7. MtoR

    MtoR Freaky Coder
    Staff Member

    Joined:
    Nov 14, 2015
    Messages:
    4,302
    Likes Received:
    646
    Why did you stated "- we created a gallery category for albums with videos only" ?

    You didn't set the pause option in admincp options ?
     
  8. Terror

    Terror New Member

    Joined:
    Mar 6, 2016
    Messages:
    20
    Likes Received:
    0
    because we thought the we needed a category for the album to be created, sry my mistake.

    found the album now via browse albums, because no thread was created. uploaded a file to that album, but no thread creation yet. the addon was not in pause mode.

    i you want to, i can provide you a temporary admin account so you can take a look at the settings by yourself.



    [edit] another weird thing, just noticed it is creating threads but in the wring forum...

    https://prnt.sc/kpmso7 (forum id 3)
    https://prnt.sc/kpmsbf
     
    #8 Terror, Sep 2, 2018
    Last edited: Sep 2, 2018
  9. MtoR

    MtoR Freaky Coder
    Staff Member

    Joined:
    Nov 14, 2015
    Messages:
    4,302
    Likes Received:
    646
    Just tested works fine to me.

    What are the ids of both forums ?
     
  10. Nik

    Nik Member

    Joined:
    Dec 18, 2015
    Messages:
    53
    Likes Received:
    3
    Still broken in latest build, see issues:

    1. I found out I have duplicate contest start threads now. You need to put some checks/validations here for dupe threads. This was an issue with the XF1 version also on occasion.
    2. Another serious bug. It created the thread in a random forum (no: 3 if that makes a difference) NOT the one specified in the options page.
    3. Also seems to be ignoring date/format {1} params. I changed default n/Y to m Y and no change on thread updates where {1} is used. Trying to get Sept 2018 instead of 9/2018 by default.
     
    #10 Nik, Sep 2, 2018
    Last edited: Sep 2, 2018
    Terror likes this.
  11. Terror

    Terror New Member

    Joined:
    Mar 6, 2016
    Messages:
    20
    Likes Received:
    0
    just like me, forum id 3 too, not the specified one, see screenshots above.
     
  12. MtoR

    MtoR Freaky Coder
    Staff Member

    Joined:
    Nov 14, 2015
    Messages:
    4,302
    Likes Received:
    646
    In which mode ?
    That would mean the contest is started twice due to the cron being ran twice a day which should not happen unless you ran it manually.

    What do you mean ? In already created threads ? Or in ones done afterwards ?

    Grumpf. I tested when @Terror reported it but I can't reproduce that.

    Are any of you familiar with coding and would be able to put an echo somewhere ?
    Otherwise I would need some ftp access.
     
  13. Nik

    Nik Member

    Joined:
    Dec 18, 2015
    Messages:
    53
    Likes Received:
    3
    I did run the cron manually and it didn't create anything until it ran again that evening. I still think you need to put some validation here to make sure this doesn't happen (I've historically had duplicate contest threads in XF1 because of .... no idea and definitely not running cron jobs manually).


    Already created threads so far.

    Is this fixed? Sorry not getting notifications from your forum so seldom check. I can put an echo if you tell me where but given there's 2 people reporting the same issue I'm thinking there's an issue there.
     
    Terror likes this.
  14. MtoR

    MtoR Freaky Coder
    Staff Member

    Joined:
    Nov 14, 2015
    Messages:
    4,302
    Likes Received:
    646
    The cron is not expected to run twice, that's impossible, unless you put it to run at midnight and your server is not time accurate.

    I have tested myself and I am not able to reproduce that at all, that's why I was asking for some help from user having the issue.
    In fact putting some echo might be complicated, I would rather need a ftp access along with an admin account with authorization to do some debug.
     
  15. Nik

    Nik Member

    Joined:
    Dec 18, 2015
    Messages:
    53
    Likes Received:
    3
    I can provide you with TeamViewer access to my PC from where you can get full FTP/admin access if you want. Let me know and we can arrange a date/time.
     
  16. MtoR

    MtoR Freaky Coder
    Staff Member

    Joined:
    Nov 14, 2015
    Messages:
    4,302
    Likes Received:
    646
    Tomorrow 21:00 GMT+1 would that fit ?
    Otherwise on Sunday 14:00 GMT+1.
     
  17. Nik

    Nik Member

    Joined:
    Dec 18, 2015
    Messages:
    53
    Likes Received:
    3
    Sunday might be better. Drop me an email on my registered email addy here.
     
  18. MtoR

    MtoR Freaky Coder
    Staff Member

    Joined:
    Nov 14, 2015
    Messages:
    4,302
    Likes Received:
    646
    Hi Nick,

    Change of plans, finally not available today.
    I can on Tuesday, Wednesday or Thursday 21:00 GMT+1.

    Clement
     
  19. Nik

    Nik Member

    Joined:
    Dec 18, 2015
    Messages:
    53
    Likes Received:
    3
    Alright I'll let you know I guess.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice