Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
expire
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
drupal.org
expire
Commits
f5dc56b1
Commit
f5dc56b1
authored
Sep 24, 2014
by
git
Committed by
Spleshka
Sep 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #2343479 by R B, Spleshka: Fatal error: Call to undefined function entity_load_single()
parent
604a065b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
expire.module
expire.module
+17
-0
includes/expire.api.inc
includes/expire.api.inc
+1
-1
includes/expire.votingapi.inc
includes/expire.votingapi.inc
+2
-2
No files found.
expire.module
View file @
f5dc56b1
...
...
@@ -281,6 +281,23 @@ function _expire_get_expiration_handler($type) {
return
$cache_objects
[
$type
];
}
/**
* Loads and returns a single entity.
*
* @param $entity_type
* The entity type to load.
*
* @param $entity_id
* The ID of the Entity to load.
*
* @return mixed
* The desired entity or FALSE if it couldn't be found.
*/
function
_expire_load_single_entity
(
$entity_type
,
$entity_id
)
{
$loaded_entity
=
entity_load
(
$entity_type
,
array
(
$entity_id
));
return
reset
(
$loaded_entity
);
}
/**
* Simple print_r to html function.
*
...
...
includes/expire.api.inc
View file @
f5dc56b1
...
...
@@ -270,7 +270,7 @@ class ExpireAPI {
foreach
(
$field_references
as
$field_reference
)
{
// Load entity.
$field_entity
=
entity_load_single
(
$field_reference
[
'entity_type'
],
$field_reference
[
'entity_id'
]);
$field_entity
=
_expire_load_single_entity
(
$field_reference
[
'entity_type'
],
$field_reference
[
'entity_id'
]);
if
(
empty
(
$field_entity
))
{
continue
;
}
...
...
includes/expire.votingapi.inc
View file @
f5dc56b1
...
...
@@ -53,7 +53,7 @@ class ExpireVotingapi implements ExpireInterface {
if
(
$expire_entity_page
)
{
// Load entity.
$entity
=
entity_load_single
(
$entity_type
,
$entity_id
);
$entity
=
_expire_load_single_entity
(
$entity_type
,
$entity_id
);
// Check whether entity is loaded.
if
(
!
empty
(
$entity
))
{
...
...
@@ -71,7 +71,7 @@ class ExpireVotingapi implements ExpireInterface {
if
(
$expire_entity
)
{
// Load entity.
$entity
=
entity_load_single
(
$entity_type
,
$entity_id
);
$entity
=
_expire_load_single_entity
(
$entity_type
,
$entity_id
);
$handler
=
_expire_get_expiration_handler
(
$entity_type
);
if
(
is_object
(
$handler
)
&&
!
empty
(
$entity
))
{
$handler
->
expire
(
$entity
,
0
,
$skip_action_check
=
TRUE
);
...
...
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