Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted March 4Mar 4 The bug still exists on 4.7.20 (107802) (I have no visibility into v5, but I'm guessing this code hasn't changed)Error: Object of class IPS\Member could not be converted to string (0) #0 /opt/forum/system/Db/Select.php(407): IPS\_Db->preparedQuery() #1 /opt/forum/system/Db/Select.php(465): IPS\Db\_Select->runQuery() #2 /opt/forum/system/Db/Select.php(389): IPS\Db\_Select->rewind() #3 /opt/forum/system/Content/Api/CommentController.php(505): IPS\Db\_Select->first() #4 /opt/forum/applications/forums/api/posts.php(346): IPS\Content\Api\_CommentController->_report() #5 /opt/forum/system/Api/Controller.php(180): IPS\forums\api\_posts->POSTitem_report() #6 /opt/forum/system/Dispatcher/Api.php(345): IPS\Api\_Controller->execute() #7 /opt/forum/api/index.php(11): IPS\Dispatcher\_Api->run() #8 {main}Fix should bediff --git a/system/Content/Api/CommentController.php b/system/Content/Api/CommentController.php index 3e68f7acf..a37aef50a 100644 --- a/system/Content/Api/CommentController.php +++ b/system/Content/Api/CommentController.php @@ -502,7 +502,7 @@ public function _report( $id ): \IPS\Api\Response try { $index = \IPS\core\Reports\Report::loadByClassAndId( \get_class( $object ), $object->$idColumn ); - $report = \IPS\Db::i()->select( '*', 'core_rc_reports', array( 'rid=? and report_by=? and date_reported > ?', $index->id, $member, time() - ( \IPS\Settings::i()->automoderation_report_again_mins * 60 ) ) )->first(); + $report = \IPS\Db::i()->select( '*', 'core_rc_reports', array( 'rid=? and report_by=? and date_reported > ?', $index->id, $member->member_id, time() - ( \IPS\Settings::i()->automoderation_report_again_mins * 60 ) ) )->first(); /* They have aleady reported, so do nothing */ throw new \IPS\Api\Exception( 'REPORTED_ALREADY', '1S425/C', 404 ); Edited March 4Mar 4 by Colonel_mortis
March 5Mar 5 Community Expert Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release.