Skip to content

Need help debugging a Vanilla 1 to Flarum migration #38

Answered by red42
red42 asked this question in Q&A
Discussion options

You must be logged in to vote

I found the issue!
The problem is in src/Storage.php:

    public function mapData(array $row, array $map): array
    {
        // @todo One of those moments I wish I had a collections library in here.
        foreach ($map as $src => $dest) {
            foreach ($row as $columnName => $value) {
                if ($columnName === $src) {
                    $row[$dest] = $value; // Add column with new name.
                    unset($row[$columnName]); // Remove old column.
                }
            }
        }

        return $row;
    }

When $dest and $columnName are the same, it's unsetting a column it should keep. So both Vanilla1 and PORT_ use UserID for the user's id column, so…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@red42
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by red42
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant