Version 5.0.0 beta 6

This commit is contained in:
Neo committed 2025-12-19 17:12:27 -08:00
1 parent 57d9db6ce2
commit fa2a720105
115 files changed
+1823 -1147

No files matched your search

+21 -11
View File
@@ -887,7 +887,7 @@ class Controller extends CoverPhotoController
/* @var $databaseColumnMap array */
$titleField = $item::$databaseColumnMap['title'];
if( strlen( Request::i()->newTitle ) > $maxLength )
if( mb_strlen( Request::i()->newTitle ) > $maxLength )
{
throw new LengthException( Member::loggedIn()->language()->addToStack( 'form_maxlength', FALSE, array( 'pluralize' => array( $maxLength ) ) ) );
}
@@ -903,6 +903,12 @@ class Controller extends CoverPhotoController
throw new InvalidArgumentException( Member::loggedIn()->language()->addToStack( 'form_tags_not_allowed', FALSE, array( 'sprintf' => array( Request::i()->newTitle ) ) ) );
}
/* Stop doing anything if the title wasn't changed */
if( $item->$titleField == $newTitle->value )
{
\IPS\Output::i()->json( $item->$titleField );
}
$item->$titleField = $newTitle->value;
$idField = $item::$databaseColumnId;
$item->save();
@@ -916,14 +922,18 @@ class Controller extends CoverPhotoController
if( SearchContent::isSearchable( $item ) )
{
Index::i()->index( $item );
if( $item::$firstCommentRequired )
{
$class = $item->firstComment();
}
else
{
$class = $item;
}
Index::i()->index( $class );
}
/* Only add the mod log entry if we actually changed the title */
if( $item->$titleField !== $oldTitle )
{
Session::i()->modLog( 'modlog__comment_edit_title', array( (string) $item->url() => FALSE, $item->$titleField => FALSE, $oldTitle => FALSE ), $item );
}
Session::i()->modLog( 'modlog__comment_edit_title', array( (string) $item->url() => FALSE, $item->$titleField => FALSE, $oldTitle => FALSE ), $item );
Output::i()->json( $item->$titleField );
}
@@ -1906,7 +1916,7 @@ class Controller extends CoverPhotoController
$class = static::$contentModel;
$item = $class::loadAndCheckPerms( Request::i()->id );
$timeLastRead = $item->timeLastRead();
$timeLastRead = ( IPS::classUsesTrait( $item, ReadMarkers::class ) ) ? $item->timeLastRead() : null;
if ( $timeLastRead instanceof DateTime )
{
@@ -1935,7 +1945,7 @@ class Controller extends CoverPhotoController
}
else
{
if ( $item->unread() )
if ( IPS::classUsesTrait( $item, ReadMarkers::class ) and $item->unread() )
{
/* If we do not have a time last read set for this content, fallback to the reset time */
$resetTimes = Member::loggedIn()->markersResetTimes( $class::$application );
@@ -2694,9 +2704,9 @@ class Controller extends CoverPhotoController
$where[] = array( $commentClass::$databasePrefix . $commentClass::$databaseColumnMap['hidden'] . '<>?', -3 );
}
if ( $commentClass::commentWhere() !== NULL )
if ( $commentClass::findCommentWhere() !== NULL )
{
$where[] = $commentClass::commentWhere();
$where[] = $commentClass::findCommentWhere();
}
if ( $container = $item->containerWrapper() )
{