Skip to:
Content

bbPress.org

Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#3207 closed defect (fixed)

e107v1 converter accesses private member of BBP_Converter_Base

Reported by: wpdennis Owned by: johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: normal Version: trunk
Component: API - Importers Keywords:
Cc:

Description

$map_userid is a private member of BBP_Converter_Base. e107v1 uses it with $this->map_userid in:

<?php
protected function callback_e107v1_userid( $field ) {

        // Strip only the user id from the topic and reply authors
        $field = preg_replace( '/(\d+?)+\.[\S\s]+/', '$1', $field );

        if ( ! isset( $this->map_userid[ $field ] ) ) {
                if ( ! empty( $this->sync_table ) ) {
                        $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT value_id, meta_value FROM {$this->sync_table_name} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_user_id', $field ) );
                } else {
                        $row = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT user_id AS value_id FROM {$this->wpdb->usermeta} WHERE meta_key = %s AND meta_value = %s LIMIT 1", '_bbp_old_user_id', $field ) );
                }

                if ( ! is_null( $row ) ) {
                        $this->map_userid[ $field ] = $row->value_id;
                } else {
                        if ( true === $this->convert_users ) {
                                $this->map_userid[ $field ] = 0;
                        } else {
                                $this->map_userid[ $field ] = $field;
                        }
                }
        }
        return $this->map_userid[ $field ];
}

$map_userid should be protected or there should be a getter method in BBP_Converter_Base.

Change History (4)

#1 @johnjamesjacoby
16 months ago

  • Milestone changed from Awaiting Review to 2.6
  • Owner set to johnjamesjacoby

#2 @johnjamesjacoby
16 months ago

  • Resolution set to fixed
  • Status changed from new to closed

In 6832:

Converter: make a few private properties protected so subclasses can reach them.

This change fixes a bug causing the e107v1 converter to fail.

Props wpdennis. Fixes #3207.

#3 @johnjamesjacoby
16 months ago

In 6833:

Converter: Remove unused argument in clean() method usage.

See #3207.

#4 @johnjamesjacoby
16 months ago

In 6834:

Converter: UX improvements to import experience:

  • Move Monitor to upper-right
  • Move actions into Monitor
  • Make database fields read-only when importer is running
  • Add a spinner

See #3207 for inspiration.

Note: See TracTickets for help on using tickets.