@@ -3052,51 +3052,6 @@ function ConvertUtf8()
30523052 list ($ upcontext ['database_charset ' ]) = explode ('_ ' , $ column_info ['Collation ' ]);
30533053 $ upcontext ['database_charset ' ] = in_array ($ upcontext ['database_charset ' ], $ charsets ) ? array_search ($ upcontext ['database_charset ' ], $ charsets ) : $ upcontext ['database_charset ' ];
30543054
3055- // Detect whether a fulltext index is set.
3056- $ request = $ smcFunc ['db_query ' ]('' , '
3057- SHOW INDEX
3058- FROM {db_prefix}messages ' ,
3059- array (
3060- )
3061- );
3062-
3063- $ upcontext ['dropping_index ' ] = false ;
3064-
3065- // If there's a fulltext index, we need to drop it first...
3066- if ($ request !== false || $ smcFunc ['db_num_rows ' ]($ request ) != 0 )
3067- {
3068- while ($ row = $ smcFunc ['db_fetch_assoc ' ]($ request ))
3069- if ($ row ['Column_name ' ] == 'body ' && (isset ($ row ['Index_type ' ]) && $ row ['Index_type ' ] == 'FULLTEXT ' || isset ($ row ['Comment ' ]) && $ row ['Comment ' ] == 'FULLTEXT ' ))
3070- $ upcontext ['fulltext_index ' ][] = $ row ['Key_name ' ];
3071- $ smcFunc ['db_free_result ' ]($ request );
3072-
3073- if (isset ($ upcontext ['fulltext_index ' ]))
3074- $ upcontext ['fulltext_index ' ] = array_unique ($ upcontext ['fulltext_index ' ]);
3075- }
3076-
3077- // Drop it and make a note...
3078- if (!empty ($ upcontext ['fulltext_index ' ]))
3079- {
3080- $ upcontext ['dropping_index ' ] = true ;
3081-
3082- $ smcFunc ['db_query ' ]('' , '
3083- ALTER TABLE {db_prefix}messages
3084- DROP INDEX ' . implode (',
3085- DROP INDEX ' , $ upcontext ['fulltext_index ' ]),
3086- array (
3087- 'db_error_skip ' => true ,
3088- )
3089- );
3090-
3091- // Update the settings table
3092- $ smcFunc ['db_insert ' ]('replace ' ,
3093- '{db_prefix}settings ' ,
3094- array ('variable ' => 'string ' , 'value ' => 'string ' ),
3095- array ('db_search_index ' , '' ),
3096- array ('variable ' )
3097- );
3098- }
3099-
31003055 // Figure out what charset we should be converting from...
31013056 $ lang_charsets = array (
31023057 'arabic ' => 'windows-1256 ' ,
@@ -3470,7 +3425,7 @@ function ConvertUtf8()
34703425 }
34713426 $ smcFunc ['db_free_result ' ]($ request );
34723427
3473- if ($ upcontext ['dropping_index ' ] && $ command_line )
3428+ if (! empty ( $ _SESSION ['dropping_index ' ]) && $ command_line )
34743429 {
34753430 echo "\n" . '' , $ txt ['upgrade_fulltext_error ' ], '' ;
34763431 flush ();
@@ -4905,11 +4860,6 @@ function template_convert_utf8()
49054860 ' , $ txt ['upgrade_current_table ' ], ' "<span id="current_table"> ' , $ upcontext ['cur_table_name ' ], '</span>"
49064861 </h3> ' ;
49074862
4908- // If we dropped their index, let's let them know
4909- if ($ upcontext ['dropping_index ' ])
4910- echo '
4911- <p id="indexmsg" class=" ' , $ upcontext ['cur_table_num ' ] == $ upcontext ['table_count ' ] ? 'inline_block ' : 'hidden ' , '> ' , $ txt ['upgrade_fulltext ' ], '</p> ' ;
4912-
49134863 // Completion notification
49144864 echo '
49154865 <p id="commess" class=" ' , $ upcontext ['cur_table_num ' ] == $ upcontext ['table_count ' ] ? 'inline_block ' : 'hidden ' , '"> ' , $ txt ['upgrade_conversion_proceed ' ], '</p> ' ;
@@ -4957,9 +4907,6 @@ function onConversionUpdate(oXMLDoc)
49574907 if (iTableNum == ' , $ upcontext ['table_count ' ], ')
49584908 {
49594909 document.getElementById( \'commess \').classList.remove( \'hidden \');
4960- if (document.getElementById( \'indexmsg \') != null) {
4961- document.getElementById( \'indexmsg \').classList.remove( \'hidden \');
4962- }
49634910 document.getElementById( \'current_tab \').classList.add( \'hidden \');
49644911 document.getElementById( \'contbutt \').disabled = 0;
49654912 document.getElementById( \'utf8_done \').value = 1;
@@ -5123,6 +5070,11 @@ function doTheDelete(theCheck)
51235070 ' , $ txt ['upgrade_luck ' ], '<br>
51245071 Simple Machines
51255072 </p> ' ;
5073+
5074+ // If we dropped their index, let's let them know
5075+ if (!empty ($ _SESSION ['dropping_index ' ]))
5076+ echo '
5077+ <p id="indexmsg"> ' , $ txt ['upgrade_fulltext_error ' ], '</p> ' ;
51265078}
51275079
51285080/**
0 commit comments