Repository navigation
Open
Description
Log:
Could not execute queued job! Message: DOMDocument::loadHTML(): Empty string supplied as input Trace:#0 [internal function]: yii\base\ErrorHandler->handleError()
#1 /app/data/modules/rss/components/MarkdownHelper.php(43): DOMDocument->loadHTML()
#2 /app/data/modules/rss/jobs/GetFeedUpdates.php(180): sij\humhub\modules\rss\components\MarkdownHelper::translateHTML()
#3 /app/data/modules/rss/jobs/GetFeedUpdates.php(280): sij\humhub\modules\rss\jobs\GetFeedUpdates->parseNewsItem()
#4 [internal function]: sij\humhub\modules\rss\jobs\GetFeedUpdates->parseNewsChannel()
#5 /app/data/modules/rss/components/RssElement.php(54): call_user_func()
#6 /app/data/modules/rss/jobs/GetFeedUpdates.php(326): sij\humhub\modules\rss\components\RssElement->each()
#7 /app/data/modules/rss/jobs/GetFeedUpdates.php(408): sij\humhub\modules\rss\jobs\GetFeedUpdates->parseNewsFeed()
#8 /app/data/modules/rss/jobs/GetFeedUpdates.php(449): sij\humhub\modules\rss\jobs\GetFeedUpdates->downloadNewsFeed()
#9 /app/code/protected/humhub/modules/queue/ActiveJob.php(33): sij\humhub\modules\rss\jobs\GetFeedUpdates->run()
#10 /app/code/protected/vendor/yiisoft/yii2-queue/src/Queue.php(246): humhub\modules\queue\ActiveJob->execute()
#11 /app/code/protected/vendor/yiisoft/yii2-queue/src/cli/Queue.php(147): yii\queue\Queue->handleMessage()
#12 /app/code/protected/vendor/yiisoft/yii2-queue/src/drivers/db/Queue.php(83): yii\queue\cli\Queue->handleMessage()
#13 [internal function]: yii\queue\db\Queue->yii\queue\db\{closure}()
#14 /app/code/protected/vendor/yiisoft/yii2-queue/src/cli/Queue.php(117): call_user_func()
#15 /app/code/protected/vendor/yiisoft/yii2-queue/src/drivers/db/Queue.php(93): yii\queue\cli\Queue->runWorker()
#16 /app/code/protected/vendor/yiisoft/yii2-queue/src/drivers/db/Command.php(56): yii\queue\db\Queue->run()
#17 [internal function]: yii\queue\db\Command->actionRun()
#18 /app/code/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#19 /app/code/protected/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams()
#20 /app/code/protected/vendor/yiisoft/yii2/console/Controller.php(184): yii\base\Controller->runAction()
#21 /app/code/protected/vendor/yiisoft/yii2/base/Module.php(534): yii\console\Controller->runAction()
#22 /app/code/protected/vendor/yiisoft/yii2/console/Application.php(181): yii\base\Module->runAction()
#23 /app/code/protected/vendor/yiisoft/yii2/console/Application.php(148): yii\console\Application->runAction()
#24 /app/code/protected/vendor/yiisoft/yii2/base/Application.php(392): yii\console\Application->handleRequest()
#25 /app/code/protected/yii(29): yii\base\Application->run()
#26 {main}
Maybe just at the beginning of the translateHTML method we should add:
if (!$html) {
return '';
}
Metadata
Metadata
Assignees
Labels
No labels
Activity
StevenJoynt commentedon Apr 4, 2022
Trace shows
#2 /app/data/modules/rss/jobs/GetFeedUpdates.php(180): sij\humhub\modules\rss\components\MarkdownHelper::translateHTML()
There isn't a call to translateHTML on line 180 of GetFeedUpdates in my version - it's later on at line 198. Has some code been deleted by accident?
Simply returning an empty string will stop the exception happening, but it looks like something has gone wrong earlier - the feed should have some contents or it's not a feed! It's probably right that an exception is being thrown in this case.
Is this a feed that has worked ok in the past? Can you access the feed using a different reader app or browser to see what should be displayed?
marc-farre commentedon Apr 15, 2022
Thanks.
I'm sorry, but I don't have enough time to investigate and it's not installed on a Humhub that I manage.
The line number was different because it was the version 1.0.0.
I updated the module version to 1.0.2 and now I have this error:
StevenJoynt commentedon Apr 16, 2022
Could you tell me the URL of the RSS feed, so I can investigate the problem?
marc-farre commentedon Apr 16, 2022
https://transitionnetwork.org/feed/
Thanks.
ArchBlood commentedon Aug 5, 2022
@funkycram I'll look at it later tonight if that's okay with @StevenJoynt
ArchBlood commentedon Aug 6, 2022
@funkycram could you have your client try the following and see if it works?
MarkdownHelper.zip
marc-farre commentedon Aug 6, 2022
Thanks @ArchBlood .
This file seems to have confusions between static and non static variables.
E.g. the variable
public static $logFileHandleis called byprivate static function log($text)with$this->logFileHandle.It should be
static::$logFileHandlemarc-farre commentedon Aug 6, 2022
Thanks @ArchBlood .
This file seems to have confusions between static and non static variables.
E.g. the variable
public static $logFileHandleis called byprivate static function log($text)with$this->logFileHandle.It should be
static::$logFileHandleArchBlood commentedon Aug 7, 2022
Yes, originally I was going to use
static::logFileHandleusing$shouldn't make much of a difference should it? Overall I believe that the file itself could be retouched and refactored better. 🤔ArchBlood commentedon Aug 7, 2022
So in turn the following should be displayed, once jobs run I see no errors actively;
I would also like to note that the other way didn't show any types of errors either, but only tested with PHP 8.0.x, further test on other versions would be recommended as well.
marc-farre commentedon Aug 9, 2022
Then, what is the difference with your new
MarkdownHelperclass that could solve the bug?See diff merge here: https://www.diffchecker.com/Y4URXxmJ
Thanks.
ArchBlood commentedon Aug 9, 2022
$this->calls the public function, whether it's static or not, within the class, that's about it.ArchBlood commentedon Aug 9, 2022
Here's another example;
You'll always get the response
Hello World!this way, the same can be said for variable functions when using$this->in place of using the standardself::orstatic::.marc-farre commentedon Aug 10, 2022
OK, thanks, but I cannot see the difference with your new MarkdownHelper class that could solve this bug.
However, I tried your code, but now there are no error, with both codes (original and yours), so I cannot tell if it solves the bug.
Anyway, thanks for the code!