Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443205
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443205
Commits
d1119049
Commit
d1119049
authored
9 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2562083
by phenaproxima, mikeryan: D7 user migration should skip over user picture if empty
parent
9210d05c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/user/migration_templates/d7_user.yml
+7
-3
7 additions, 3 deletions
core/modules/user/migration_templates/d7_user.yml
core/modules/user/src/Tests/Migrate/d7/MigrateUserTest.php
+11
-2
11 additions, 2 deletions
core/modules/user/src/Tests/Migrate/d7/MigrateUserTest.php
with
18 additions
and
5 deletions
core/modules/user/migration_templates/d7_user.yml
+
7
−
3
View file @
d1119049
...
...
@@ -25,9 +25,13 @@ process:
migration
:
d7_user_role
source
:
roles
user_picture
:
plugin
:
migration
migration
:
d7_file
source
:
picture
-
plugin
:
default_value
source
:
picture
default_value
:
null
-
plugin
:
migration
migration
:
d7_file
destination
:
plugin
:
entity:user
migration_dependencies
:
...
...
This diff is collapsed.
Click to expand it.
core/modules/user/src/Tests/Migrate/d7/MigrateUserTest.php
+
11
−
2
View file @
d1119049
...
...
@@ -24,13 +24,19 @@ class MigrateUserTest extends MigrateDrupal7TestBase {
*
* @var array
*/
static
$modules
=
array
(
'user'
);
static
$modules
=
array
(
'file'
,
'image'
,
'user'
);
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
parent
::
setUp
();
// Prepare to migrate user pictures as well.
$this
->
installEntitySchema
(
'file'
);
$this
->
executeMigration
(
'user_picture_field'
);
$this
->
executeMigration
(
'user_picture_field_instance'
);
$this
->
executeMigration
(
'd7_user_role'
);
$this
->
executeMigration
(
'd7_user'
);
}
...
...
@@ -56,8 +62,10 @@ protected function setUp() {
* The user's initial e-mail address.
* @param string[] $roles
* Role IDs the user account is expected to have.
* @param bool $has_picture
* Whether the user is expected to have a picture attached.
*/
protected
function
assertEntity
(
$id
,
$label
,
$mail
,
$access
,
$login
,
$blocked
,
$langcode
,
$init
,
array
$roles
=
[
RoleInterface
::
AUTHENTICATED_ID
])
{
protected
function
assertEntity
(
$id
,
$label
,
$mail
,
$access
,
$login
,
$blocked
,
$langcode
,
$init
,
array
$roles
=
[
RoleInterface
::
AUTHENTICATED_ID
]
,
$has_picture
=
FALSE
)
{
/** @var \Drupal\user\UserInterface $user */
$user
=
User
::
load
(
$id
);
$this
->
assertTrue
(
$user
instanceof
UserInterface
);
...
...
@@ -74,6 +82,7 @@ protected function assertEntity($id, $label, $mail, $access, $login, $blocked, $
$this
->
assertIdentical
(
$langcode
,
$user
->
preferred_admin_langcode
->
value
);
$this
->
assertIdentical
(
$init
,
$user
->
getInitialEmail
());
$this
->
assertIdentical
(
$roles
,
$user
->
getRoles
());
$this
->
assertIdentical
(
$has_picture
,
!
$user
->
user_picture
->
isEmpty
());
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment