teraßyte Posted July 30, 2022 Posted July 30, 2022 (edited) While I was looking into changing the number of comments per page for database records (see this link) I found out that IPS actually already allows to control it. The problem is that the number is tied to the setting that also controls the number of records shown per page. The setting I'm talking about is "Field Options > Records per page" when editing a database settings. The name implies it controls the number of records, but at the same time it controls also the number of comments: /** * Set custom posts per page setting * * @return int */ public static function getCommentsPerPage() { if ( ! empty( \IPS\cms\Databases\Dispatcher::i()->recordId ) ) { $class = 'IPS\cms\Records' . static::$customDatabaseId; try { $record = $class::load( \IPS\cms\Databases\Dispatcher::i()->recordId ); if ( $record->_forum_record and $record->_forum_comments and \IPS\Application::appIsEnabled('forums') ) { return \IPS\forums\Topic::getCommentsPerPage(); } } catch( \OutOfRangeException $e ) { /* recordId is usually the record we're viewing, but this method is called on recordFeed widgets in horizontal mode which means recordId may not be __this__ record, so fail gracefully */ return static::database()->field_perpage; } } else if( static::database()->forum_record and static::database()->forum_comments and \IPS\Application::appIsEnabled('forums') ) { return \IPS\forums\Topic::getCommentsPerPage(); } return static::database()->field_perpage; } While simply changing the text to mention it controls also comments can be a fix, I would rather you add a separate setting that controls comments specifically. Without a new setting it would be impossible to keep showing 25 records per page but only 5 comments per page. You'd have to also show only 5 records per page. It's not ideal to have the same setting control both. Edited July 30, 2022 by teraßyte Afrodude, SeNioR- and opentype 3
Solution Marc Posted November 3, 2023 Solution Posted November 3, 2023 This issue has been resolved in our recent 4.7.14 release of the platform. Please upgrade to resolve the issue, and if you see any further problems at that point, please let us know.
Recommended Posts