Version 4.7.6

This commit is contained in:
Neo committed 2025-12-19 16:05:19 -08:00
1 parent 8ba7d43898
commit 7b7404e741
1085 files changed
+30590 -7837

No files matched your search

+28
View File
@@ -390,10 +390,24 @@ class _Query extends \IPS\Content\Search\Query
/* Some container types cannot be cached */
$classes = [];
$conditions = [];
$noSimilarContentClasses = [];
foreach ( \IPS\Application::allExtensions( 'core', 'ContentRouter', FALSE ) as $object )
{
$classes = array_merge( $object->classes, $classes );
if ( ! $object->similarContent )
{
foreach( $object->classes as $class )
{
$noSimilarContentClasses[] = $class;
if ( is_subclass_of( $class, 'IPS\Content\Item' ) and isset( $class::$commentClass ) )
{
$noSimilarContentClasses[] = $class::$commentClass;
}
}
}
}
/* Some nodes have complex permissions, so avoid any permission issues by not selecting these */
@@ -440,6 +454,20 @@ class _Query extends \IPS\Content\Search\Query
}
}
/* Prevent some things from being in similar content widget */
if ( \count( $noSimilarContentClasses ) )
{
$this->mustNot[] = array(
'bool' => array(
'filter' => array(
array(
'terms' => array( 'index_class' => $noSimilarContentClasses )
)
)
)
);
}
/* Only show non-hidden and approved items */
$this->setHiddenFilter( static::HIDDEN_VISIBLE );
}