What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

Bug Fixed Contest thread not created

Nik

Member
@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) {
}
}
 
Last edited:
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.
 
Last edited:
Why did you stated "- we created a gallery category for albums with videos only" ?

You didn't set the pause option in admincp options ?
 
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
 
Last edited:
Just tested works fine to me.

What are the ids of both forums ?

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.
 
Last edited:
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.

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.

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.

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

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.
just like me, forum id 3 too, not the specified one, see screenshots above.

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.
 
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.

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).


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

Already created threads so far.

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.

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.
 
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).

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.

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.

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.
 
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.

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.
 
Hi Nick,

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

Clement
 

From bespoke add-on development to complex integrations and specialized enhancements, we offer a range of XenForo development services designed to help your community thrive.

Start discussing your needs
Back
Top
Cart