Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check tables incorrect if check #2061

Closed
JN-Jones opened this issue Jun 25, 2015 · 0 comments
Closed

check tables incorrect if check #2061

JN-Jones opened this issue Jun 25, 2015 · 0 comments
Assignees
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:bug Type: Bug. An issue causing error / flaw / malfunction
Milestone

Comments

@JN-Jones
Copy link
Contributor

Is it me or the following piece of code is wrong?
PHP Code:
    if($tables_list)    {        $query = $db->query("CHECK TABLE {$tables_list}CHANGED;");        while($table = $db->fetch_array($query))        {            if(!in_array($table['Msg_text'], $ok))            {                if($table['Table'] != $mybb->config['database']['database'].".".TABLE_PREFIX."settings" && $setting_done != true)                {                    $boardclosed = $mybb->settings['boardclosed'];                    $boardclosed_reason = $mybb->settings['boardclosed_reason'];                    $db->update_query("settings", array('value' => 1), "name='boardclosed'", 1);                    $db->update_query("settings", array('value' => $db->escape_string($lang->error_database_repair)), "name='boardclosed_reason'", 1);                    rebuild_settings();                    $setting_done = true;                }                $db->query("REPAIR TABLE {$table['Table']}");                $repaired[] = $table['Table'];            }        }        if($table['Table'] != $mybb->config['database']['table_prefix'].".".TABLE_PREFIX."settings" && $setting_done == true)        {            $db->update_query("settings", array('value' => (int)$boardclosed), "name='boardclosed'", 1);            $db->update_query("settings", array('value' => $db->escape_string($boardclosed_reason)), "name='boardclosed_reason'", 1);            rebuild_settings();        }    } 

.\mybb\inc\tasks\checktables.php

The last if should only check for $setting_done == true.

Original thread: check tables incorrect if check

@JN-Jones JN-Jones added t:bug Type: Bug. An issue causing error / flaw / malfunction s:confirmed Status: Confirmed. Retested and found the issue exists b:1.8 Branch: 1.8.x labels Jun 25, 2015
@JN-Jones JN-Jones added this to the 1.8.6 milestone Jun 25, 2015
@JN-Jones JN-Jones modified the milestones: 1.8.6, 1.8.7 Aug 26, 2015
@Stefan-MyBB Stefan-MyBB modified the milestones: 1.8.7, 1.8.8 Mar 2, 2016
@Stefan-MyBB Stefan-MyBB modified the milestones: 1.8.8, 1.8.9 Aug 31, 2016
JN-Jones added a commit to JN-Jones/mybb that referenced this issue Nov 10, 2016
@JN-Jones JN-Jones self-assigned this Nov 10, 2016
@JN-Jones JN-Jones added s:resolved Status: Resolved. Solution implemented or scheduled and removed s:confirmed Status: Confirmed. Retested and found the issue exists labels Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:bug Type: Bug. An issue causing error / flaw / malfunction
Projects
None yet
Development

No branches or pull requests

2 participants