Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
entity_embed
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
entity_embed
Commits
f930e282
Commit
f930e282
authored
Apr 09, 2015
by
Devin Carlson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved UUID support.
parent
8c4e0dad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
entity_embed.admin.inc
entity_embed.admin.inc
+2
-2
entity_embed.module
entity_embed.module
+1
-1
includes/entity_embed.file_usage.inc
includes/entity_embed.file_usage.inc
+12
-3
No files found.
entity_embed.admin.inc
View file @
f930e282
...
...
@@ -96,7 +96,7 @@ function entity_embed_dialog_form($form, &$form_state, $input, $filter_format, $
}
$default
=
''
;
if
(
!
empty
(
$entity_element
[
'data-entity-uuid'
]))
{
if
(
!
empty
(
$entity_element
[
'data-entity-uuid'
])
&&
module_exists
(
'uuid'
)
)
{
$entity
=
entity_uuid_load
(
$entity_element
[
'data-entity-type'
],
array
(
$entity_element
[
'data-entity-uuid'
]));
$entity
=
reset
(
$entity
);
}
...
...
@@ -150,7 +150,7 @@ function entity_embed_dialog_form($form, &$form_state, $input, $filter_format, $
case
'embed'
:
$form
[
'#title'
]
=
t
(
'Edit embedded entity'
);
if
(
!
empty
(
$entity_element
[
'data-entity-uuid'
]))
{
if
(
!
empty
(
$entity_element
[
'data-entity-uuid'
])
&&
module_exists
(
'uuid'
)
)
{
$entity
=
entity_uuid_load
(
$entity_element
[
'data-entity-type'
],
array
(
$entity_element
[
'data-entity-uuid'
]));
$entity
=
reset
(
$entity
);
}
...
...
entity_embed.module
View file @
f930e282
...
...
@@ -406,7 +406,7 @@ function _entity_embed_render_placeholders($text) {
$uuid
=
$node
->
getAttribute
(
'data-entity-uuid'
);
$id
=
$node
->
getAttribute
(
'data-entity-id'
);
if
(
!
empty
(
$uuid
))
{
if
(
!
empty
(
$uuid
)
&&
module_exists
(
'uuid'
)
)
{
$entity
=
entity_uuid_load
(
$entity_type
,
array
(
$uuid
));
$entity
=
reset
(
$entity
);
}
...
...
includes/entity_embed.file_usage.inc
View file @
f930e282
...
...
@@ -165,9 +165,18 @@ function entity_embed_filter_parse_from_fields($entity_type, $entity) {
$xpath
=
new
\
DOMXPath
(
$dom
);
foreach
(
$xpath
->
query
(
'//*[@data-entity-type="file" and (@data-entity-uuid or @data-entity-id)]'
)
as
$node
)
{
$id
=
$node
->
getAttribute
(
'data-entity-uuid'
)
?:
$node
->
getAttribute
(
'data-entity-id'
);
$fids
[]
=
$id
;
$uuid
=
$node
->
getAttribute
(
'data-entity-uuid'
);
$id
=
$node
->
getAttribute
(
'data-entity-id'
);
if
(
!
empty
(
$uuid
)
&&
module_exists
(
'uuid'
))
{
$ids
=
entity_get_id_by_uuid
(
'file'
,
array
(
$uuid
));
$fid
=
reset
(
$ids
);
}
else
{
$fid
=
$id
;
}
$fids
[]
=
$fid
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment