Skip to:
Content

bbPress.org

Opened 3 days ago

Closed 3 days ago

Last modified 34 hours ago

#3686 closed defect (bug) (fixed)

PHPWind importer mishandles topic status, reply counts, and forum date defaults

Reported by: johnjamesjacoby Owned by: johnjamesjacoby
Priority: normal Milestone: 2.6.18
Component: API - Importers Version: trunk
Severity: normal Keywords: has-unit-tests
Cc:

Description

While reviewing the PHPWind 9 importer for #3684, I found three adjacent, pre-existing conversion bugs:

  • callback_topic_status() treats bbs_threads.tpcstatus as an enumerated value. PHPWind defines it as a bit field: positions 1 and 2 are STATUS_LOCKED and STATUS_CLOSED. The current exact-value switch imports status 2 as published and imports any combined status containing either bit as published.
  • callback_topic_reply_count() subtracts one from bbs_threads.replies. PHPWind already stores the number of replies separately from the topic; its display code adds one when it needs the total number of posts. The importer therefore makes every nonzero reply count one too small.
  • Four forum date defaults use to_type => 'bbs_forum' instead of the converter destination type forum, so the converter never applies those mappings.

Expected behavior:

  • Import topics as closed when PHPWind's locked or closed bit is set, including combined bit-field values.
  • Preserve the non-negative PHPWind reply count without subtracting the topic.
  • Correct or remove the unreachable forum date mappings according to the converter's normal date behavior.

Regression tests should cover individual and combined status bits, zero and nonzero reply counts, and the chosen handling of the forum date defaults.

This should remain separate from the password-import corrections in #3684.

Change History (7)

#1 @johnjamesjacoby
3 days ago

  • Owner set to johnjamesjacoby
  • Resolutionfixed
  • Status newclosed

In 7592:

Importers: Correct PHPWind topic metadata.

Interpret PHPWind topic status as bit flags, preserve the source reply count, and apply default forum dates to the forum destination. This corrects closed topic state, reply counts, and forum timestamps while adding focused regression coverage.

In branches/2.6, for 2.6.18.

Fixes #3686.

#2 @johnjamesjacoby
3 days ago

In 7593:

Importers: Correct PHPWind topic metadata.

Interpret PHPWind topic status as bit flags, preserve the source reply count, and apply default forum dates to the forum destination. This corrects closed topic state, reply counts, and forum timestamps while adding focused regression coverage.

In trunk, for 2.7.

Fixes #3686.

#3 @johnjamesjacoby
2 days ago

In 7600:

Importers: Preserve source counts during conversion.

Prevent post-status transition callbacks from incrementing imported forum and topic counts again while converted posts are inserted. This restores converter behavior predating centralized count synchronization and fixes doubled PHPWind counts found by database-backed import testing.

In branches/2.6, for 2.6.18.

See #3686.

#4 @johnjamesjacoby
2 days ago

In 7601:

Importers: Preserve source counts during conversion.

Prevent post-status transition callbacks from incrementing imported forum and topic counts again while converted posts are inserted. This restores converter behavior predating centralized count synchronization and fixes doubled PHPWind counts found by database-backed import testing.

In trunk, for 2.7.0.

See #3686.

#5 @johnjamesjacoby
2 days ago

In 7602:

Importers: Normalize final compatibility details.

Correct the PHPWind status-map documentation to match its source bitmask, reject malformed scalar values in the example password verifier, and add regression coverage. Align anonymous-author detection with trunk to avoid loose-comparison behavior on PHP 7.2.

In branches/2.6, for 2.6.18.

See #3684.
See #3686.

#6 @johnjamesjacoby
2 days ago

In 7603:

Importers: Normalize final compatibility details.

Correct the PHPWind status-map documentation to match its source bitmask, reject malformed scalar values in the example password verifier, and add regression coverage.

In trunk, for 2.7.

See #3684.
See #3686.

#7 @johnjamesjacoby
34 hours ago

  • Keywords has-unit-tests added; needs-patch removed
  • Milestone Awaiting Review2.6.18
Note: See TracTickets for help on using tickets.