Using latest devs of all modules.

Out of 2088 messages, 1933 get imported.

Error messages created include:

14	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
84	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
...
623	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
624	Informational	Undefined property: stdClass::$to File C:\xampp\htdocs\drupaltest\sites\all\modules\migrate_extras\privatemsg.inc, line 120(file: C:\xampp\htdocs\drupaltest\sites\all\modules\migrate_extras\privatemsg.inc, line 120)
624	Error	Invalid argument supplied for foreach() File C:\xampp\htdocs\drupaltest\sites\all\modules\privatemsg\privatemsg.module, line 1614
631	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
632	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
...
699	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
718	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
729	Informational	Undefined property: stdClass::$to File C:\xampp\htdocs\drupaltest\sites\all\modules\migrate_extras\privatemsg.inc, line 120(file: C:\xampp\htdocs\drupaltest\sites\all\modules\migrate_extras\privatemsg.inc, line 120)
729	Error	Invalid argument supplied for foreach() File C:\xampp\htdocs\drupaltest\sites\all\modules\privatemsg\privatemsg.module, line 1614
749	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
750	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
754	Informational	Undefined property: stdClass::$to File C:\xampp\htdocs\drupaltest\sites\all\modules\migrate_extras\privatemsg.inc, line 120(file: C:\xampp\htdocs\drupaltest\sites\all\modules\migrate_extras\privatemsg.inc, line 120)
754	Error	Invalid argument supplied for foreach() File C:\xampp\htdocs\drupaltest\sites\all\modules\privatemsg\privatemsg.module, line 1614
756	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
761	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
...
875	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
880	Informational	Undefined property: stdClass::$to File C:\xampp\htdocs\drupaltest\sites\all\modules\migrate_extras\privatemsg.inc, line 120(file: C:\xampp\htdocs\drupaltest\sites\all\modules\migrate_extras\privatemsg.inc, line 120)
880	Error	Invalid argument supplied for foreach() File C:\xampp\htdocs\drupaltest\sites\all\modules\privatemsg\privatemsg.module, line 1614
883	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
...
3381	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178
4012	Error	array_flip(): Can only flip STRING and INTEGER values! File C:\xampp\htdocs\drupaltest\includes\entity.inc, line 178

Note: It's worth noting that one must have set the proper permissions for the private messages to be imported at all.

Oddly, the messages that do get through are all addressed to user 1...

When navigating to the messages path I see only 3 pages worth of messages, which is kind of far from the 1933 that did get imported.

Comments

marktheshark’s picture

Clarification:

Seems the messages to user 1 are messages of old users. >See also

Nevertheless, I would expect user 1 to be able to see all messages, but this is probably related with the privatemsg module itself.

JeremyFrench’s picture

#1323442: Can only flip STRING and INTEGER values is the issue in migrate which is related to this core bug #1102570: array_flip() [function.array-flip] issue in DrupalDefaultEntityController / entity.inc

However neither of these will solve the issue for us. I think it is to do with the fact that there is no user with that ID (as suggested).

select author_id, count(*) from phpbb_privmsgs left outer join phpbb_users on author_id = user_id where user_id is null group by author_id;

Shows that with my data at least there are messages from users that no longer exist. These can't be imported as we have no details on them.

This gives us three options that I can see:

  1. Ignore records from users which don't exist.
  2. Create a dummy user for each deleted user which will be disabled
  3. Create a dummy user to use in all cases where the user has been deleted

I am tempted to go with option 1, it seems the least troublesome. At least it will be consistent with Drupal's data retention policy with deleted users.

marktheshark’s picture

Imho, I would go with with approach 2, as the data retention policy is configurable, isn't it?

Using 3 (same user for all messages) would be problematic I'm afraid, because the granularity per deleted user would be lost.

marktheshark’s picture

Sorry for bothering you again with this issue, but perhaps it would be easy to implement setting the uid for these messages to the Anonymous User (say, option 4).

Problem is, I can set the uid to 0 for topics / posts, since they are imported, but it appears privatemsgs do not all get imported for some reason (even though some do get mapped to uid 1).

If I had all private messages, I would be able to manipulate the DB to assign these entries to the Anonymous User.

JeremyFrench’s picture

Status: Active » Fixed

Should be now fixed and follow the specified deleted user behavior.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.