Skip to:
Content

bbPress.org

Opened 12 years ago

Closed 10 years ago

Last modified 10 years ago

#2347 closed defect (bug) (fixed)

phpBB importer conflates all deleted users as single user "anonymous"

Reported by: dpknauss's profile dpknauss Owned by: netweb's profile netweb
Milestone: 2.6 Priority: high
Severity: major Version: 2.3.2
Component: API - Importers Keywords:
Cc: stephen@…

Description

If phpBB forum users have been deactivated, when they are imported to bbPress they are merged into a single "anonymous" user. If there are many posts associated with deactivated users, the identity of their authors is lost.

Attachments (1)

2347.diff (7.4 KB) - added by netweb 11 years ago.

Download all attachments as: .zip

Change History (24)

#1 @dpknauss
12 years ago

  • Summary changed from phpBB importer conflates all deactivated users as single user "anonymous" to phpBB importer conflates all deleted users as single user "anonymous"

Sorry, this should have read "deleted" not "deactivated" users. In phpBB you are allowed to delete users and retain their posts, in which case the post author's name and identity is retained on the post even though the user has been deleted. If this is done and the forum is later imported to bbPress, all posts whose authors have been deleted receuive the same "anonymous" user in Wordpress as their new author.

#2 @dpknauss
12 years ago

NB: When phpBB users are deleted but their posts are retained, the author name shown on their posts is derived from and stored in the "topics" table under column "topic_first_poster_name."

#3 @johnjamesjacoby
11 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 2.5

That's too bad. The converter will need some updates to account for this situation.

Moving to 2.5.

#4 @netweb
11 years ago

  • Cc stephen@… added
  • Owner set to netweb

I'll have a play with this and see what I can come up with...

Not sure that we want to create a WordPress user/username for each deleted phpBB user to placehold the original topic/reply author to only then have to deactivate this user in WordPress...

#5 @netweb
11 years ago

Related: #2381

#6 @dpknauss
11 years ago

There probably needs to be a custom field for author aliases and a short explanation of the modifications necessary to handle this in themes for unlinked author bylines.

#7 @netweb
11 years ago

Topic Poster always includes a value in:
phpbb_topics.topic_first_poster_name

Reply Poster contains a value only if the user was deleted with posts retained:
phpbb_posts.post_username

We can add the following to each section of the import script that will add an entry for every post in wp_postmeta for the _bbp_phpbb_deleted_username value (even if it is blank an entry will still be created.

                // Store deleted phpBB topic username (Stored in postmeta)
                $this->field_map[] = array(
                        'from_tablename' => 'topics',
                        'from_fieldname' => 'topic_first_poster_name',
                        'to_type'        => 'topic',
                        'to_fieldname'   => '_bbp_phpbb_deleted_username'
                );
                // Store deleted phpBB reply username (Stored in postmeta)
                $this->field_map[] = array(
                        'from_tablename' => 'posts',
                        'from_fieldname' => 'post_username',
                        'to_type'        => 'reply',
                        'to_fieldname'   => '_bbp_phpbb_deleted_username'
                );

What is then done with this information is up for grabs?

  • Some may want to create a WordPress username with the bbPress role 'blocked' for each instance...
  • Some may be happy to leave all the posts attributed to the 'Anonymous' user...
  • Some may want to create a specific user eg 'Archived User' with some profile information suggesting this user is no longer active/registered...

I also don't see any way to handle WordPress username alias' that would let us assign each of these users as an aliased username of 'Anonymous' for example.

#8 follow-up: @johnjamesjacoby
11 years ago

If the phpBB user was deleted, let's use _bbp_anonymous_name postmeta.

#9 @johnjamesjacoby
11 years ago

  • Milestone changed from 2.5 to 2.6

#10 in reply to: ↑ 8 @netweb
11 years ago

Replying to johnjamesjacoby:

If the phpBB user was deleted, let's use _bbp_anonymous_name postmeta.

Cool

#11 @netweb
11 years ago

How phpBB handles deleted users:

  • Deleted users in phpBB get assigned the Anonymous phpBB user ID of 1 and use topic_first_poster_name for the topic author name and post_username for the reply author name.
  • bbPress currently imports the Anonymous user along with additional bot/crawler users (as noted here). Each of these users are defined by users.user_tpye = 2. These users need to be deleted manually after the import is finished.

Plan of attack:

  • Include topic_first_poster_name in the topics import as _bbp_phpbb_topic_first_poster_name in wp_postmeta
  • Include post_username in the replies import as _bbp_phpbb_post_username in wp_postmeta
  • Include user_tpye in the users import as _bbp_phpbb_user_type in wp_usermeta

Post import run a new repair tool that:

  • Copies the _bbp_phpbb_topic_first_poster_name/_bbp_phpbb_post_username values into the topic/reply post_id of wp_postmeta as _bbp_anonymous_name
  • Delete WP Users whose _bbp_phpbb_user_type = 2
  • Cleanup/Remove meta key _bbp_phpbb_user_type from wp_usermeta
  • Cleanup/Remove meta keys _bbp_phpbb_topic_first_poster_name & _bbp_phpbb_post_username from wp_postmeta

@netweb
11 years ago

#12 @netweb
11 years ago

  • Keywords has-patch added; needs-patch removed

In 2347.diff
phpBB.php phpBB v3.x Importer

  • Include topic_first_poster_name => _bbp_phpbb_topic_first_poster_name field map in phpBB topics import
  • Include post_username => _bbp_phpbb_post_username field map in phpBB replies import
  • Include user_tpye => _bbp_phpbb_user_type field map in phpBB users import

tools.php New Repair Tool phpBB post import repair tasks

  • Update topic meta _bbp_anonymous_name with original phpBB anonymous user name
  • Update reply meta _bbp_anonymous_name with original phpBB anonymous user name
  • Delete each imported phpBB bot user replacing post authors with bbPress anonymous user ID

#13 @netweb
11 years ago

  • Keywords has-patch removed

I'm going to refresh this patch to a more generic patch to support other forums anonymous/deleted users.

#14 @netweb
10 years ago

In 5538:

Introduce support for importing anonymous topics and replies in converter.php

  • Adds two new steps to the import conversion process:
    • "Convert anonymous topic authors" and "Convert anonymous reply authors"
  • Utilizes existing bbPress support for anonymous user topics and replies
    • Adds post meta key _bbp_anonymous_name to imported anonymous topic and replies
    • Depending on the forum being imported these may be referenced as anonymous, guest or deleted topics or replies
  • Imported topics and replies are assigned post meta key _bbp_old_topic_author_name_id or _bbp_old_reply_author_name_id respectively that is then compared using the returned true or false in the callback function callback_check_anonymous() of each of importers that are are supported.

Props netweb. See #2347

#15 @netweb
10 years ago

In 5539:

Include anonymous topic and reply import support in phpBB.php and SMF.php importers
Props netweb. See #2347

#16 @netweb
10 years ago

In 5541:

Include anonymous topic and reply import support in Drupal7.php importer
Props netweb. See #2347

#17 @netweb
10 years ago

In 5542:

Vanilla2: Include anonymous topic and reply import support in Vanilla.php importer
Props netweb. See #2347

#18 @netweb
10 years ago

In 5544:

Move callback callback_check_anonymous from individual importers to BBP_Converter_Base in converter.php.

  • Allows us to lean on callback_userid to determine multiple anonymous or guest topic and reply authors during import and reduces code duplication

Props netweb. See #2347

#19 @netweb
10 years ago

In 5546:

Include anonymous topic and reply import support in vBulletin 3 (vBulletin3.php) and vBulletin 4 (vBulletin.php) importers
Props netweb. See #2347

#20 @netweb
10 years ago

In 5548:

Include anonymous topic and reply import support in SimplePress 5 (SimplePress5.php) importer
Props netweb. See #2347

#21 @netweb
10 years ago

In 5550:

Include anonymous topic and reply import support in XMB 1.x (XMB.php) and PunBB (PunBB.php) importers
Props netweb. See #2347

#22 @netweb
10 years ago

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

Closing this as fixed:

  • Callback callback_check_anonymous in BBP_Converter_Base in converter.php
    • Allows us to lean on callback_userid to determine multiple anonymous, deleted, or guest topic and reply authors during import.
  • Current importers supporting anonymous, deleted, or guest topic or reply authors or users are:
    • Drupal 7 - Drupal7.php
    • phpBB - phpBB.php
    • PunBB PunBB.php
    • SimplePress 5 - SimplePress5.php
    • SMF - SMF.php
    • Vanilla2 - Vanilla.php
    • vBulletin 3 - vBulletin3.php
    • vBulletin 4 - vBulletin.php
    • XMB 1.x - XMB.php

If there is an importer that is not included in the above list that supposts anonymous, deleted, or guest users please create a new ticket requesting support for the importer to support importing anonymous, deleted, and guest topic or reply authors with as many specific details as possible.

#23 @netweb
10 years ago

In 5554:

Include anonymous reply author name in Drupal7.php importer.
Props netweb. See #2347

Note: See TracTickets for help on using tickets.