Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3424701
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-3424701
Commits
4203cff7
Verified
Commit
4203cff7
authored
1 year ago
by
Dave Long
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3403265
by acbramley: Remove RevisionLogEntityTrait overrides in BlockContent
parent
1cc37927
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/block_content/src/Entity/BlockContent.php
+0
-58
0 additions, 58 deletions
core/modules/block_content/src/Entity/BlockContent.php
core/modules/block_content/tests/src/Kernel/BlockContentRevisionsTest.php
+53
-0
53 additions, 0 deletions
...ck_content/tests/src/Kernel/BlockContentRevisionsTest.php
with
53 additions
and
58 deletions
core/modules/block_content/src/Entity/BlockContent.php
+
0
−
58
View file @
4203cff7
...
...
@@ -8,7 +8,6 @@
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\Core\Field\BaseFieldDefinition
;
use
Drupal\block_content
\BlockContentInterface
;
use
Drupal\user\UserInterface
;
/**
* Defines the content block entity class.
...
...
@@ -242,63 +241,6 @@ public function setInfo($info) {
return
$this
;
}
/**
* {@inheritdoc}
*/
public
function
getRevisionCreationTime
()
{
return
$this
->
get
(
'revision_created'
)
->
value
;
}
/**
* {@inheritdoc}
*/
public
function
setRevisionCreationTime
(
$timestamp
)
{
$this
->
set
(
'revision_created'
,
$timestamp
);
return
$this
;
}
/**
* {@inheritdoc}
*/
public
function
getRevisionUser
()
{
return
$this
->
get
(
'revision_user'
)
->
entity
;
}
public
function
setRevisionUser
(
UserInterface
$account
)
{
$this
->
set
(
'revision_user'
,
$account
);
return
$this
;
}
/**
* {@inheritdoc}
*/
public
function
getRevisionUserId
()
{
return
$this
->
get
(
'revision_user'
)
->
entity
->
id
();
}
/**
* {@inheritdoc}
*/
public
function
setRevisionUserId
(
$user_id
)
{
$this
->
set
(
'revision_user'
,
$user_id
);
return
$this
;
}
/**
* {@inheritdoc}
*/
public
function
getRevisionLogMessage
()
{
return
$this
->
get
(
'revision_log'
)
->
value
;
}
/**
* {@inheritdoc}
*/
public
function
setRevisionLogMessage
(
$revision_log_message
)
{
$this
->
set
(
'revision_log'
,
$revision_log_message
);
return
$this
;
}
/**
* {@inheritdoc}
*/
...
...
This diff is collapsed.
Click to expand it.
core/modules/block_content/tests/src/Kernel/BlockContentRevisionsTest.php
0 → 100644
+
53
−
0
View file @
4203cff7
<?php
namespace
Drupal\Tests\block_content\Kernel
;
use
Drupal\block_content
\Entity\BlockContent
;
use
Drupal\KernelTests\KernelTestBase
;
use
Drupal\block_content
\Entity\BlockContentType
;
/**
* Tests revision based functions for Block Content.
*
* @group block_content
*/
class
BlockContentRevisionsTest
extends
KernelTestBase
{
/**
* {@inheritdoc}
*/
protected
static
$modules
=
[
'block'
,
'block_content'
,
'system'
,
'user'
,
];
/**
* {@inheritdoc}
*/
public
function
setUp
():
void
{
parent
::
setUp
();
$this
->
installEntitySchema
(
'user'
);
$this
->
installEntitySchema
(
'block_content'
);
}
/**
* Tests block content revision user id doesn't throw error with null field.
*/
public
function
testNullRevisionUser
():
void
{
BlockContentType
::
create
([
'id'
=>
'basic'
,
'label'
=>
'A basic block type'
,
])
->
save
();
$block
=
BlockContent
::
create
([
'info'
=>
'Test'
,
'type'
=>
'basic'
,
'revision_user'
=>
NULL
,
]);
$block
->
save
();
$this
->
assertNull
(
$block
->
getRevisionUserId
());
}
}
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