Topic on User talk:MarkAHershberger

Extension:HitCounter in mediawiki 1.28.0 Database Error 1054

3
Xk casper (talkcontribs)

If you setup the HitCounter extension version 1.28.0 it will show up the error 1054 like:

Query: SELECT page_namespace,page_title FROM `page` WHERE page_namespace = '0' AND page_is_redirect = '0' ORDER BY page_counter DESC LIMIT 6 Function: DynamicPageListHooks::renderDynamicPageList Error: 1054 Unknown column 'page_counter' in 'order clause' (localhost)

After add the code:

    // process the query,change fields into page and hit_counter by casper 2017.01.20
    if($orderMethod == 'popularity'){
        $tables[] = 'hit_counter';//
        $join["hit_counter"] = array( 'LEFT JOIN','page.page_id=hit_counter.page_id' );
        $res = $dbr->select( $tables, $fields, $where, __METHOD__, $options, $join );
    } else{
        $res = $dbr->select( $tables, $fields, $where, __METHOD__, $options, $join );
    }

This problem will be solved。

MarkAHershberger (talkcontribs)

Please let me know which file you modified so I can create a patch.

Xk casper (talkcontribs)

the file is “/htdocs/extensions/intersection/DynamicPageList.hooks.php(513)”

Reply to "Extension:HitCounter in mediawiki 1.28.0 Database Error 1054"