Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
drupal
Commits
8bd39cd9
Commit
8bd39cd9
authored
15 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#711592
by linclark and scor: Fixed rdf_preprocess_user_profile() uses currently logged in user.
parent
3756cdd8
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/rdf/rdf.module
+1
-1
1 addition, 1 deletion
modules/rdf/rdf.module
modules/rdf/rdf.test
+11
-8
11 additions, 8 deletions
modules/rdf/rdf.test
with
12 additions
and
9 deletions
modules/rdf/rdf.module
+
1
−
1
View file @
8bd39cd9
...
...
@@ -476,7 +476,7 @@ function rdf_preprocess_user_profile(&$variables) {
// Adds RDFa markup to the user profile page. Fields displayed in this page
// will automatically describe the user.
// @todo move to user.module
$account
=
user_load
(
$variables
[
'
user'
]
->
uid
)
;
$account
=
$variables
[
'
elements'
][
'#account'
]
;
if
(
!
empty
(
$account
->
rdf_mapping
[
'rdftype'
]))
{
$variables
[
'attributes_array'
][
'typeof'
]
=
$account
->
rdf_mapping
[
'rdftype'
];
$variables
[
'attributes_array'
][
'about'
]
=
url
(
'user/'
.
$account
->
uid
);
...
...
This diff is collapsed.
Click to expand it.
modules/rdf/rdf.test
+
11
−
8
View file @
8bd39cd9
...
...
@@ -291,19 +291,22 @@ class RdfMappingDefinitionTestCase extends DrupalWebTestCase {
* Create a random user and ensure the default mapping for user is used.
*/
function
testUserAttributesInMarkup
()
{
// Create a user with access to user profiles.
$user
=
$this
->
drupalCreateUser
(
array
(
'access user profiles'
));
$this
->
drupalLogin
(
$user
);
// Create two users, one with access to user profiles.
$user1
=
$this
->
drupalCreateUser
(
array
(
'access user profiles'
));
$user2
=
$this
->
drupalCreateUser
();
$this
->
drupalLogin
(
$user1
);
// Browse to the user profile page.
$this
->
drupalGet
(
'user/'
.
$user
->
uid
);
$this
->
drupalGet
(
'user/'
.
$user
2
->
uid
);
// Ensure the default bundle mapping for user is used on the user profile
// page. These attributes come from the user default bundle definition.
$profile_url
=
url
(
'user/'
.
$user
->
uid
);
$user_profile_about
=
$this
->
xpath
(
"//div[@class='profile' and @typeof='sioc:User' and @about='
$profile_url
']"
);
$this
->
assertTrue
(
!
empty
(
$user_profile_about
),
t
(
'RDFa markup found on user profile page'
));
$profile_url
=
url
(
'user/'
.
$user
2
->
uid
);
$user
2
_profile_about
=
$this
->
xpath
(
"//div[@class='profile' and @typeof='sioc:User' and @about='
$profile_url
']"
);
$this
->
assertTrue
(
!
empty
(
$user
2
_profile_about
),
t
(
'RDFa markup found on user profile page'
));
// User creates node.
// User 2 creates node.
$this
->
drupalLogin
(
$user2
);
$node
=
$this
->
drupalCreateNode
(
array
(
'type'
=>
'article'
,
'promote'
=>
1
));
$this
->
drupalLogin
(
$user1
);
$this
->
drupalGet
(
'node/'
.
$node
->
nid
);
// Ensures the default bundle mapping for user is used on the Authored By
// information on the node.
...
...
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