Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+47 -45
View File
@@ -2,9 +2,9 @@
/**
* @brief 4.1.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 29 Jul 2015
* @version SVN_VERSION_NUMBER
*/
@@ -84,35 +84,13 @@ class _Upgrade
{
return "Setting upgrade notifications email address";
}
/**
* Step 3: Rebuild search index
* Step 3: Upgrade emoticons
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
\IPS\Content\Search\Index::i()->rebuild();
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step3CustomTitle()
{
return "Initiating search index rebuild";
}
/**
* Step 4: Upgrade emoticons
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step4()
{
$json = json_decode( file_get_contents( \IPS\ROOT_PATH . '/' . \IPS\CP_DIRECTORY ."/install/emoticons/data.json" ), TRUE );
@@ -146,17 +124,17 @@ class _Upgrade
*
* @return string
*/
public function step4CustomTitle()
public function step3CustomTitle()
{
return "Upgrading emoticons";
}
/**
* Step 5: Populate default streams
* Step 4: Populate default streams
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step5()
public function step4()
{
/* Grab the inserts from the schematic as they will always be the most up to date */
$json = json_decode( file_get_contents( \IPS\ROOT_PATH . '/applications/core/data/schema.json' ), TRUE );
@@ -178,18 +156,18 @@ class _Upgrade
*
* @return string
*/
public function step5CustomTitle()
public function step4CustomTitle()
{
return "Populating default streams";
}
/**
* Step 6
* Step 5
* Fix followers from a 3.x upgrade - We have to do this here because the original code was wrong, and we need to fix people affected between then and now
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step6()
public function step5()
{
/* Init */
$perCycle = 250;
@@ -292,7 +270,7 @@ class _Upgrade
else
{
\IPS\Db::i()->dropTable( 'core_follow_backup' );
unset( $_SESSION['_step2Count'] );
unset( $_SESSION['_step5Count'] );
return TRUE;
}
}
@@ -302,24 +280,24 @@ class _Upgrade
*
* @return string
*/
public function step6CustomTitle()
public function step5CustomTitle()
{
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
if( !isset( $_SESSION['_step2Count'] ) )
if( !isset( $_SESSION['_step5Count'] ) )
{
$_SESSION['_step2Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_follow' )->first();
$_SESSION['_step5Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_follow' )->first();
}
return "Fixing existing follows (Fixed so far: " . ( ( $limit > $_SESSION['_step2Count'] ) ? $_SESSION['_step2Count'] : $limit ) . ' out of ' . $_SESSION['_step2Count'] . ')';
return "Fixing existing follows (Fixed so far: " . ( ( $limit > $_SESSION['_step5Count'] ) ? $_SESSION['_step5Count'] : $limit ) . ' out of ' . $_SESSION['_step5Count'] . ')';
}
/**
* Step 7: Adjust email SMTP host/protocol
* Step 6: Adjust email SMTP host/protocol
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step7()
public function step6()
{
/* We only need to do this if there is an SMTP host and it is something like tls://domain */
if( \IPS\Settings::i()->smtp_host AND mb_strpos( \IPS\Settings::i()->smtp_host, '://' ) !== FALSE )
@@ -345,17 +323,17 @@ class _Upgrade
*
* @return string
*/
public function step7CustomTitle()
public function step6CustomTitle()
{
return "Adjusting email configuration";
}
/**
* Step 8: Remove some legacy columns if they still exist
* Step 7: Remove some legacy columns if they still exist
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step8()
public function step7()
{
if ( \IPS\Db::i()->checkForColumn( 'core_bulk_mail', 'mail_pergo' ) )
{
@@ -380,7 +358,7 @@ class _Upgrade
*
* @return string
*/
public function step8CustomTitle()
public function step7CustomTitle()
{
return "Cleaning up bulk mail database table";
}
@@ -410,6 +388,20 @@ class _Upgrade
\IPS\Lang::copyCustom( 'core', 'home_name_value', "menu_item_{$id}" );
\IPS\Lang::deleteCustom( 'core', 'home_name_value' );
}
/* We have to fix nexus language bits */
if ( \IPS\Application::appIsEnabled('nexus') )
{
/* There is a support tab we will need to fix */
$menu = \IPS\Db::i()->select( 'id', 'core_menu', array( "extension=? AND config LIKE '%app=nexus%' AND parent IS NULL", 'CustomItem' ) )->first();
\IPS\Lang::saveCustom( 'nexus', 'menu_item_' . $menu, 'Support' );
/* There is a my details menu we will need to fix */
$menu = \IPS\Db::i()->select( 'parent', 'core_menu', array( "app=? AND is_menu_child=?", 'nexus', 1 ) )->first();
\IPS\Lang::saveCustom( 'nexus', 'menu_item_' . $menu, 'My Details' );
}
/* And pages? */
if ( \IPS\Application::appIsEnabled('cms') )
@@ -417,7 +409,7 @@ class _Upgrade
$rootId = \IPS\Db::i()->insert( 'core_menu', array(
'app' => 'core',
'extension' => 'CustomItem',
'config' => json_encode( array( 'menu_custom_item_url' => 'app=cms&module=pages&controller=page', 'internal' => 'content' ) ),
'config' => json_encode( array( 'menu_custom_item_url' => 'app=cms&module=pages&controller=page', 'internal' => '' ) ),
'position' => ++$maxPosition,
'parent' => NULL,
'permissions' => '*',
@@ -440,6 +432,17 @@ class _Upgrade
{
if ( $menuItem['menu_type'] == 'page' )
{
/* We need to make sure the page actually exists, otherwise the site will be down with a 500 ISE after upgrade */
try
{
$_page = \IPS\Db::i()->select( 'page_id', 'cms_pages', array( 'page_id=?', $menuItem['menu_content'] ) )->first();
}
catch( \UnderflowException $e )
{
/* If the page doesn't exist, just don't add it to the core_menu table and continue */
continue;
}
$app = 'cms';
$extension = 'Pages';
$config = array( 'menu_content_page' => $menuItem['menu_content'], 'menu_title_page_type' => ( $menuItem['menu_title'] ? 1 : 0 ) );
@@ -698,5 +701,4 @@ class _Upgrade
return TRUE;
}
}