• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed IPB import (users step, infinite loop)

#1
Bug in Importer/IPBoard.php:1445 - _getSelectUserSql
Code:
        return '
            SELECT members.*, pfields_content.*, profile_portal.*,
                apr.row_perm_cache AS admin_restrictions
            FROM ' . $this->_prefix . 'members AS members
            LEFT JOIN  ' . $this->_prefix . 'pfields_content AS pfields_content ON
                (pfields_content.member_id = members.member_id)
            LEFT JOIN ' . $this->_prefix . 'profile_portal AS profile_portal ON
                (profile_portal.pp_member_id = members.member_id)
            LEFT JOIN ' . $this->_prefix .  'admin_permission_rows AS apr ON
                (apr.row_id = members.member_id AND apr.row_id_type = \'member\')
            WHERE '  . $where . '
            ORDER BY members.member_id
        ';
If no records in pfields_content content for user, left join will return NULL, so pfields_content.member_id will return NULL too. members.member_id and pfields_content.member_id has save field name, so in result array it will be member_id and... NULL, because pfields_content.member_id was last.
Fix:
Code:
        return '
          SELECT  pfields_content.*, members.*, profile_portal.*,
                apr.row_perm_cache AS admin_restrictions
            FROM ' . $this->_prefix . 'members AS members
            LEFT JOIN  ' . $this->_prefix . 'pfields_content AS pfields_content ON
                (pfields_content.member_id = members.member_id)
            LEFT JOIN ' . $this->_prefix . 'profile_portal AS profile_portal ON
                (profile_portal.pp_member_id = members.member_id)
            LEFT JOIN ' . $this->_prefix .  'admin_permission_rows AS apr ON
                (apr.row_id = members.member_id AND apr.row_id_type = \'member\')
            WHERE '  . $where . '
            ORDER BY members.member_id
        ';