Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export PMs/Profile data error. #7763

Closed
jdarwood007 opened this issue May 31, 2023 · 6 comments · Fixed by #7770
Closed

Export PMs/Profile data error. #7763

jdarwood007 opened this issue May 31, 2023 · 6 comments · Fixed by #7770
Assignees
Milestone

Comments

@jdarwood007
Copy link
Member

Description

These are being logged in the PHP error log

PHP Fatal error: Uncaught ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements in /Sources/News.php:2649
Stack trace:
#0 /Sources/News.php(2649): array_combine(Array, Array)
#1 /Sources/tasks/ExportProfileData.php(242): getXmlPMs('smf', true)
#2 /Sources/tasks/ExportProfileData.php(552): ExportProfileData_Background->exportXml(Array)
#3 /Sources/tasks/ExportProfileData.php(120): ExportProfileData_Background->exportXmlXslt(Array)
#4 /cron.php(249): ExportProfileData_Background->execute()
#5 /cron.php(131): perform_task(Array)
#6 {main}
thrown in /Sources/News.php on line 2649

Steps to reproduce

  1. Unknown, being logged in the error logs.

Environment (complete as necessary)

  • Version/Git revision: 2.1.4
  • Database Type:
  • Database Version:
  • PHP Version:

Additional information/references

These are being logged on SimpleMachines website. No more information is available

@jdarwood007 jdarwood007 added this to the 2.1.5 milestone May 31, 2023
@Sesquipedalian
Copy link
Member

Sesquipedalian commented Jun 1, 2023

I'll take a look.

EDIT: Oh man, I remember this gnarly query. This is might get ugly before it gets better.

@Sesquipedalian
Copy link
Member

It seems that there is a way to end up with a mismatch between the number of recipient IDs and the number of recipient names in the query that gets all the PM data in getXmlPMs().

I haven't started working on a fix yet, but I suspect that we'll have to break up that query into two separate ones.

@jdarwood007
Copy link
Member Author

Is the mismatch due to a deleted account? That would at least make sense why you have more ids than names.

@Sesquipedalian
Copy link
Member

That's my suspicion, yes, but there could be other ways to get into this inconsistent state. I haven't had a chance to dig into it further, so I can't say at this point.

@Sesquipedalian Sesquipedalian self-assigned this Jun 14, 2023
@Sesquipedalian
Copy link
Member

I have not been able to reproduce the error yet. I've tried sending PMs to accounts, then deleting those accounts, and then exporting profile data with PMs included, but that doesn't produce the error. It doesn't matter if there was a single recipient or multiple recipients, any number of which were subsequently deleted. All that ever happens is that the deleted recipients are left out of the recipients list, and if there are no existing recipients, then the PM itself is left out of the export.

At this point, I am back to square one. 😕

@Sesquipedalian
Copy link
Member

Sesquipedalian commented Jun 14, 2023

I figured it out.

It seems that we allow commas in member names, but the query in question concatenates member names using a comma. I checked on simplemachines.org, and there are some registered members that do in fact have commas in their names.

At any rate, I should have a fix submitted soon.

Sesquipedalian added a commit to Sesquipedalian/SMF that referenced this issue Jun 14, 2023
Fixes SimpleMachines#7763

Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants