Version 4.7.23

This commit is contained in:
Neo committed 2025-12-19 16:21:27 -08:00
1 parent 7124a02564
commit 25ddeb65d6
1791 files changed
+76990 -44452

No files matched your search

+40 -4
View File
@@ -250,7 +250,7 @@ abstract class _Index extends \IPS\Patterns\Singleton
}
/* If this comment is hidden, don't actually mark as the last comment as that will cause this item to be hidden in search if we are getting only the last comment. */
if ( $isLastComment AND $object->hidden() )
if ( $isLastComment AND $object->hidden() AND !$object->isFirst() )
{
$isLastComment = 0;
}
@@ -432,6 +432,41 @@ abstract class _Index extends \IPS\Patterns\Singleton
'index_item_solved' => ( $itemClass and \IPS\IPS::classUsesTrait( $itemClass, 'IPS\Content\Solvable' ) ) ? ( $object->item()->mapped('solved_comment_id') == $object->$idColumn ) ? 1 : 0 : NULL
);
}
/**
* Get the object ID of the first comment.
* Used for posts, where the index_object_id is NOT the topic ID
*
* @param \IPS\Content\Searchable $object
* @return int|null
*/
protected function getFirstCommentId( \IPS\Content\Searchable $object ) : ?int
{
if( $object instanceof \IPS\Content\Comment )
{
$itemClass = $object::$itemClass;
if( $itemClass::$firstCommentRequired )
{
if ( $object->isFirst() )
{
$column = $object::$databaseColumnId;
return $object->$column;
}
else if ( isset( $itemClass::$databaseColumnMap['first_comment_id'] ) )
{
$column = $itemClass::$databaseColumnMap['first_comment_id'];
return $object->item()->$column;
}
else
{
$column = $itemClass::$databaseColumnId;
return $object->item()->firstComment()->$column;
}
}
}
return null;
}
/**
* Index an item
@@ -455,9 +490,9 @@ abstract class _Index extends \IPS\Patterns\Singleton
* Retrieve the search ID for an item
*
* @param \IPS\Content\Searchable $object Item to add
* @return void
* @return string
*/
abstract public function getIndexId( \IPS\Content\Searchable $object );
abstract public function getIndexId( \IPS\Content\Searchable $object ): string;
/**
* Remove item
@@ -555,9 +590,10 @@ abstract class _Index extends \IPS\Patterns\Singleton
* @param string $class The class
* @param int|NULL $indexItemId The index item ID
* @param int|NULL $ignoreId ID to ignore because it is being removed
* @param int|null $firstCommentId The first comment in this item, used only if $firstCommentRequired
* @return void
*/
abstract public function resetLastComment( $class, $indexItemId, $ignoreId = NULL );
abstract public function resetLastComment( $class, $indexItemId, $ignoreId = NULL, $firstCommentId = NULL );
/**
* Given a list of item index IDs, return the ones that a given member has participated in