Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

+15 -5
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief Upgrader: Pre-upgrade check
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 27 Feb 2015
* @version SVN_VERSION_NUMBER
*/
/* Clear settings store in case we've already been here */
@@ -36,6 +35,17 @@ while ( $table = $tables->fetch_assoc() )
{
continue;
}
/* Skip if it's an _old or _utftemp table */
if( mb_substr( $tableName, -4 ) == '_old' )
{
continue;
}
if( mb_substr( $tableName, -8 ) == '_utftemp' )
{
continue;
}
/* Ticket 909929 - SHOW TABLES LIKE 'ibf_%' can match tables like ibf3_table_name */
if ( $prefix and mb_strpos( $tableName, $prefix ) === FALSE )
@@ -1,12 +1,11 @@
<?php
/**
* @brief Upgrader: Custom Upgrade Options
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 5 Jun 2014
* @version SVN_VERSION_NUMBER
*/
$options = array();
@@ -1,12 +1,11 @@
<?php
/**
* @brief Upgrader: Custom Post Upgrade Message
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 16 May 2016
* @version SVN_VERSION_NUMBER
*/
$message = \IPS\Theme::i()->getTemplate( 'global' )->block( NULL, "Please take a few minutes to thoroughly review your community for any issues. If any issues are found, please use the Support tool in the ACP for further assistance." );
@@ -171,7 +171,7 @@
"zerofill": false,
"binary": false,
"allow_null": false,
"default": "''",
"default": "",
"auto_increment": false,
"comment": "Key"
},
@@ -536,7 +536,7 @@
"zerofill": false,
"binary": false,
"allow_null": false,
"default": "''",
"default": "",
"auto_increment": false,
"comment": ""
}
@@ -555,7 +555,7 @@
"zerofill": false,
"binary": false,
"allow_null": false,
"default": "''",
"default": "",
"auto_increment": false,
"comment": ""
}
@@ -712,7 +712,7 @@
"zerofill": false,
"binary": false,
"allow_null": false,
"default": "''",
"default": "",
"auto_increment": false,
"comment": ""
}
@@ -730,7 +730,7 @@
"zerofill": false,
"binary": false,
"allow_null": false,
"default": "''",
"default": "",
"auto_increment": false,
"comment": ""
}
@@ -780,7 +780,7 @@
"decimals": null,
"values": [],
"allow_null": false,
"default": "''",
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
@@ -1265,7 +1265,7 @@
"zerofill": false,
"binary": false,
"allow_null": false,
"default": "''",
"default": "",
"auto_increment": false,
"comment": "Key"
},
@@ -2705,7 +2705,7 @@
"core_applications",
{
"app_author": "Invision Power Services, Inc.",
"app_website": "https:\/\/www.invisionpower.com"
"app_website": "https:\/\/www.invisioncommunity.com"
},
"app_directory='core'"
]
+113 -17
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief 4.0.0 Alpha 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 25 Mar 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_40000;
@@ -359,7 +358,6 @@ class _Upgrade
{
try
{
/* @link http://community.invisionpower.com/resources/bugs.html/_/4-0-0/error-upgrade-data-truncated-r49262 */
$selected = array_filter( $selected, function( $val ){
if( $val == 'email' OR $val == 'inline' )
{
@@ -439,20 +437,24 @@ class _Upgrade
if( $row['pp_main_photo'] )
{
$_test = parse_url( $row['pp_main_photo'] );
$_local = parse_url( \IPS\Settings::i()->base_url );
if( !isset( $_test['host'] ) OR !$_test['host'] )
if( isset( $_test['host'] ) AND $_test['host'] == $_local['host'] )
{
$row['pp_main_photo'] = $settings['upload_url'] . '/' . $row['pp_main_photo'];
/* We just want dir/file.ext and not the full URL */
$row['pp_main_photo'] = str_replace( \IPS\Settings::i()->base_url, '', $row['pp_main_photo'] );
}
}
if( $row['pp_thumb_photo'] )
{
$_test = parse_url( $row['pp_thumb_photo'] );
$_local = parse_url( \IPS\Settings::i()->base_url );
if( !isset( $_test['host'] ) OR !$_test['host'] )
if( isset( $_test['host'] ) AND $_test['host'] == $_local['host'] )
{
$row['pp_thumb_photo'] = $settings['upload_url'] . '/' . $row['pp_thumb_photo'];
/* We just want dir/file.ext and not the full URL */
$row['pp_thumb_photo'] = str_replace( \IPS\Settings::i()->base_url, '', $row['pp_thumb_photo'] );
}
}
@@ -461,7 +463,6 @@ class _Upgrade
{
$row['temp_ban'] = -1;
}
/* http://community.invisionpower.com/4bugtrack/temp_ban-issues-while-3x-to-4-upgrade-r1404/ */
else if ( $row['temp_ban'] !== 0 )
{
$arr = array();
@@ -1175,6 +1176,12 @@ class _Upgrade
{
$options = explode( '|', $v['content'] );
$realOptions = array();
/* If this field isn't required, then we need to add a blank option */
if ( $v['required'] === FALSE )
{
$realOptions[''] = '';
}
foreach( $options as $_index => $option )
{
@@ -1319,7 +1326,7 @@ class _Upgrade
$_SESSION['pfields'] = array();
}
$_SESSION['pfields'][ $field['pf_id'] ] = array( 'content' => $field['pf_content'], 'use_keys' => ( $update['pf_type'] == 'CheckboxSet' ) ? TRUE : FALSE );
$_SESSION['pfields'][ $field['pf_id'] ] = array( 'content' => $field['pf_content'], 'use_keys' => ( $update['pf_type'] == 'CheckboxSet' ) ? TRUE : FALSE, 'required' => (bool) $field['pf_not_null'] );
$extra[ $field['pf_id'] ] = $field['pf_id'];
$update['pf_content'] = json_encode( $newOptions );
}
@@ -1402,7 +1409,6 @@ class _Upgrade
continue;
}
/* @link http://community.invisionpower.com/4bugtrack/beta-4a-upgrade-error-location-step-7-application-core-r937/ */
$selected = '';
if( $data['selected'] )
@@ -2392,8 +2398,7 @@ DROP INDEX like_lookup_area"
$result = @json_encode( $data );
/* @link http://community.invisionpower.com/4bugtrack/beta-8-json_encode-invalid-utf-8-sequence-in-argument-during-upgrade-from-347-r2636/
Sometimes the array unserializes fine but there are still "bad" characters in there */
/* Sometimes the array unserializes fine but there are still "bad" characters in there */
if( $result === FALSE )
{
$data = unserialize( $poll['choices'] );
@@ -3610,7 +3615,7 @@ DROP INDEX like_lookup_area"
"set_permissions" => '*',
"set_is_default" => 1,
"set_author_name" => "Invision Power Services",
"set_author_url" => "http:\/\/www.invisionpower.com",
"set_author_url" => "https:\/\/www.invisioncommunity.com",
"set_emo_dir" => "'default'",
"set_added" => 0,
"set_updated" => 0,
@@ -3660,7 +3665,6 @@ DROP INDEX like_lookup_area"
\IPS\Db::i()->update( 'core_sys_lang', array( 'lang_order' => 2 ) );
\IPS\Db::i()->update( 'core_sys_lang', array( 'lang_order' => 1 ), "lang_default=1" );
/* http://community.invisionpower.com/resources/bugs.html/_/ip-board/warn-logs-vs-members-warn-logs-r42251 */
if( \IPS\Db::i()->checkForTable('warn_logs') )
{
\IPS\Db::i()->dropTable( 'warn_logs' );
@@ -3902,6 +3906,98 @@ DROP INDEX like_lookup_area"
{
return "Removing old unused data";
}
/**
* Serialized: Customer History - This is intentionally here so this can be processed before the Commerce upgrade, by which time this table won't exist.
*
* @return mixed 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 step23()
{
if( \IPS\Db::i()->checkForTable( 'nexus_customer_history' ) )
{
$offset = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
$select = \IPS\Db::i()->select( '*', 'nexus_customer_history', NULL, 'log_id', array( $offset, 500 ) );
if ( count( $select ) )
{
foreach ( $select as $row )
{
\IPS\Db::i()->update( 'nexus_customer_history', array( 'log_data' => json_encode( \unserialize( $row['log_data'] ) ) ), array( 'log_id=?', $row['log_id'] ) );
}
return $offset + 500;
}
else
{
unset( $_SESSION['_step23Count'] );
return TRUE;
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step23CustomTitle()
{
if( !\IPS\Db::i()->checkForTable( 'nexus_customer_history' ) )
{
return NULL;
}
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
if( !isset( $_SESSION['_step23Count'] ) )
{
$_SESSION['_step23Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_history' )->first();
}
return "Upgrading commerce customer history (Upgraded so far: " . ( ( $limit > $_SESSION['_step23Count'] ) ? $_SESSION['_step23Count'] : $limit ) . ' out of ' . $_SESSION['_step23Count'] . ')';
}
/**
* Update log_by column - This is intentionally here so this can be processed before the Commerce upgrade, by which time this table won't exist.
*
* @return mixed 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 step24()
{
if( \IPS\Db::i()->checkForTable( 'nexus_customer_history' ) )
{
\IPS\Db::i()->changeColumn( 'nexus_customer_history', 'log_by',
array(
'allow_null' => true,
'auto_increment' => false,
'binary' => false,
'comment' => 'Action performed by',
'decimals' => NULL,
'default' => NULL,
'length' => 20,
'name' => 'log_by',
'type' => 'BIGINT',
'unsigned' => true,
'values' => array(),
'zerofill' => false,
)
);
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step24CustomTitle()
{
return "Upgrading commerce customer history";
}
/**
* Finish - This is run after all apps have been upgraded