Report Improvements by Xon

Report Improvements by Xon 2.18.3

No permission to download
Code:
An exception occurred: [TypeError] SV\ReportImprovements\XF\Entity\ApprovalQueue::getReportableContentInternal(): Argument #1 ($content) must be of type XF\Mvc\Entity\Entity, null given, called in /www/wwwroot/example.com/src/addons/SV/ReportImprovements/XF/Entity/ApprovalQueue.php on line 62 in src/addons/SV/ReportImprovements/XF/Entity/ApprovalQueue.php on line 65

SV\ReportImprovements\XF\Entity\ApprovalQueue->getReportableContentInternal() in src/addons/SV/ReportImprovements/XF/Entity/ApprovalQueue.php at line 62
SV\ReportImprovements\XF\Entity\ApprovalQueue->getReportableContent() in src/XF/Mvc/Entity/Entity.php at line 167
XF\Mvc\Entity\Entity->get() in src/XF/Mvc/Entity/Entity.php at line 119
XF\Mvc\Entity\Entity->__get() in src/addons/SV/ReportImprovements/XF/Entity/ApprovalQueue.php at line 105
SV\ReportImprovements\XF\Entity\ApprovalQueue->getSvReport() in src/XF/Mvc/Entity/Entity.php at line 167
XF\Mvc\Entity\Entity->get() in src/XF/Mvc/Entity/Entity.php at line 119
XF\Mvc\Entity\Entity->__get() in src/addons/SV/ReportImprovements/XF/Entity/ApprovalQueue.php at line 145
SV\ReportImprovements\XF\Entity\ApprovalQueue->setContent() in src/XF/Repository/ApprovalQueue.php at line 145
XF\Repository\ApprovalQueue->addContentToUnapprovedItems() in src/addons/SV/SignupAbuseBlocking/XF/Repository/ApprovalQueue.php at line 19
SV\SignupAbuseBlocking\XF\Repository\ApprovalQueue->addContentToUnapprovedItems() in src/XF/Pub/App.php at line 341
XF\Pub\App->updateModeratorCaches() in src/XF/Pub/App.php at line 200
XF\Pub\App->start() in src/XF/App.php at line 2483
XF\App->run() in src/XF.php at line 524
XF::runApp() in index.php at line 20

Getting this error in this addon!
 
This happens when there is an xf_approval_queue entry but the content it is linked to is missing. That really shouldn't happen.
 
Code:
ErrorException: Require Comment Reporter (svReportImpro_expireUserId) to point to a valid user src/XF/Error.php:77

#0 src/XF.php(219): XF\Error->logError('Require Comment...', false)
#1 src/addons/SV/ReportImprovements/Job/ResolveInactiveReport.php(42): XF::logError('Require Comment...')
#2 src/XF/Job/AbstractJob.php(28): SV\ReportImprovements\Job\ResolveInactiveReport->setupData(Array)
#3 src/XF/Container.php(276): XF\Job\AbstractJob->__construct(Object(XF\Cli\App), 402792, Array)
#4 src/XF/App.php(1687): XF\Container->createObject('SV\\ReportImprov...', Array, true)
#5 src/XF/Container.php(234): XF\App->XF\{closure}('SV\\ReportImprov...', Array, Object(XF\Container))
#6 src/XF/App.php(3081): XF\Container->create('job', 'SV\\ReportImprov...', Array)
#7 src/XF/Job/Manager.php(238): XF\App->job('SV\\ReportImprov...', 402792, Array)
#8 src/XF/Job/Manager.php(243): XF\Job\Manager->getJobRunner(Array)
#9 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#10 src/XF/Job/Manager.php(171): XF\Job\Manager->runJobEntry(Array, 8)
#11 src/XF/Cli/Runner.php(223): XF\Job\Manager->runById(402792, 8)
#12 src/XF/Cli/Runner.php(112): XF\Cli\Runner->postExecutionCleanUp(Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 cmd.php(15): XF\Cli\Runner->run()
#14 {main}

My error log is full of these.
 
Search for the admincp option svReportImpro_expireUserId and set it to a valid user. This can happen if the original admin user the installer sets up (userId == 1) is deleted, or the user this field was pointed to was deleted.

This includes using the merge feature.
 
Trying to get into the thread approval panel and getting this:

Code:
Fatal error: Declaration of SV\ReportImprovements\XF\Repository\Report::getModeratorsWhoCanHandleReport(XF\Entity\Report $report) must be compatible with XF\Repository\Report::getModeratorsWhoCanHandleReport(XF\Entity\Report $report, $notifiableOnly = false) in /home/geekberr/public_html/social/src/addons/SV/ReportImprovements/XF/Repository/Report.php on line 480
 
Many of my add-ons will likely not support XF2.3, I'm in the middle of a major feature update for some of my add-ons so it'll be later next month I can start seriously working on XF2.3 support
Do you know which ones will? I may have to hold off on updating until there's a viable alternative if that's the case. I use pretty much every single "X Improvements" addon and find use for a lot of them.
 
Hello seeing this error with the latest version of your most wonderful plugin.
Code:
Error: Call to a member function hydrateRelation() on null 
src/addons/SV/ReportImprovements/Search/Data/ReportComment.php:137

Stack
Code:
#0 src/XF/Search/Search.php(39): SV\ReportImprovements\Search\Data\ReportComment->getIndexData(Object(SV\ReportImprovements\XF\Entity\ReportComment))
#1 src/addons/SV/SearchImprovements/XF/Search/SearchPatch.php(119): XF\Search\Search->index('report_comment', Object(SV\ReportImprovements\XF\Entity\ReportComment), true)
#2 src/XF/Search/Search.php(61): SV\SearchImprovements\XF\Search\SearchPatch->index('report_comment', Object(SV\ReportImprovements\XF\Entity\ReportComment))
#3 src/XF/Search/Search.php(75): XF\Search\Search->indexEntities('report_comment', Object(XF\Mvc\Entity\ArrayCollection))
#4 src/XF/Job/SearchIndex.php(45): XF\Search\Search->indexByIds('report_comment', Array)
#5 src/XF/Job/Manager.php(260): XF\Job\SearchIndex->run(7.94877)
#6 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 7.94877)
#7 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 7.94877)
#8 job.php(43): XF\Job\Manager->runQueue(false, 8)
#9 {main}

So the line throwing the error is: $entity->WarningLog->hydrateRelation('ReportComment', $entity);

In this function:
PHP:
    public function getIndexData(Entity $entity): ?IndexRecord
    {
        if (!$this->isAddonFullyActive)
        {
            // This function may be invoked when the add-on is disabled, just return nothing to index
            return null;
        }
        assert($entity instanceof ReportCommentEntity);

        /** @var \SV\ReportImprovements\XF\Entity\Report $report */
        $report = $entity->Report;
        if ($report === null)
        {
            return null;
        }

        if ($entity->warning_log_id !== null)
        {
            $entity->WarningLog->hydrateRelation('ReportComment', $entity);
            return $this->searcher->handler('warning_log')->getIndexData($entity->WarningLog);
        }
 
        return IndexRecord::create('report_comment', $entity->report_comment_id, [
            'title'         => '',
            'message'       => $this->getMessage($entity),
            'date'          => $entity->comment_date,
            'user_id'       => $entity->user_id,
            'discussion_id' => $entity->report_id,
            'metadata'      => $this->getMetaData($entity),
        ]);
    }

I've not done any further digging yet, alas my PHP is a tad rusty these days having switched to other languages a long time ago... so any assistance would be very gratefully received.
 
That really shouldn't be happening, as it implies the WarningLog entity was hard deleted (which the addon does not do).

Can you run this query?

SQL:
SELECT report_comment_id, warning_log_id
FROM xf_report_comment
WHERE warning_log_id is not null AND warning_log_id not in (SELECT warning_log_id FROM xf_sv_warning_log)

This really shouldn't return anything, but if it does something hasn't worked as expected
 
Yes I assumed the error implied that the WarningLog object was null hence didn't have any methods. Anyhow the query returns a nice long table of 27515 rows in our case, so probably better to have this exciting sample:

SQL:
SELECT report_comment_id, warning_log_id FROM xf_report_comment WHERE warning_log_id is not null AND warning_log_id not in (SELECT warning_log_id FROM xf_sv_warning_log) limit 10;
+-------------------+----------------+
| report_comment_id | warning_log_id |
+-------------------+----------------+
|                 2 |              0 |
|                 3 |              0 |
|                 4 |              0 |
|                 5 |              0 |
|                 6 |              0 |
|                 7 |              0 |
|                 8 |              0 |
|                 9 |              0 |
|                10 |              0 |
|                11 |              0 |
+-------------------+----------------+
All the warning_log_id's are 0:
SQL:
SELECT distinct(warning_log_id) FROM xf_report_comment WHERE warning_log_id is not null AND warning_log_id not in (SELECT warning_log_id FROM xf_sv_warning_log);
+----------------+
| warning_log_id |
+----------------+
|              0 |
+----------------+
1 row in set (0.00 sec)
I wonder what went wrong or what I mucked up? I'm just doing a beta build for a board migration from XF1 so there is milage for some funky fun and games. So worst case I can blow things away and start over. The board was using the version of your report improvements in XF1 FWIW so the DB is going to have some legacy bits and pieces in depending on what the XF2 upgrade migrations did to it.
 

The installer should have migrated those warning_log_id: 0 values to being null. I'm wondering it the installer got damaged at some stage as it should have applied the schema updates before the SQL was run.

You should be able to just run this SQL on the XF1 install before updating to XF2:
SQL:
alter table xf_report_comment modify column `warning_log_id` int(10) unsigned DEFAULT NULL;

UPDATE xf_report_comment
SET warning_log_id = NULL
WHERE warning_log_id = 0

You can also run it after, just re-index after running the SQL.
 
Thank you so much. You've excelled above and beyond, I've twiddled the table to change the 0's to nulls and will make a note to check when I do either the proper upgrade or the next beta.

Well that awesome customer service has sold me on my wondering about buying a few of your paid extensions, time to get those I think!
 
Top Bottom