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
1bc7daad
Commit
1bc7daad
authored
Sep 08, 2016
by
slashrsm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CodeSnifer auto fixes.
parent
bd6c1bdd
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
42 additions
and
65 deletions
+42
-65
entity_embed.module
entity_embed.module
+2
-0
src/EntityEmbedBuilder.php
src/EntityEmbedBuilder.php
+1
-1
src/EntityEmbedBuilderInterface.php
src/EntityEmbedBuilderInterface.php
+1
-1
src/EntityEmbedDisplay/EntityEmbedDisplayBase.php
src/EntityEmbedDisplay/EntityEmbedDisplayBase.php
+1
-2
src/EntityEmbedDisplay/EntityEmbedDisplayInterface.php
src/EntityEmbedDisplay/EntityEmbedDisplayInterface.php
+0
-5
src/EntityEmbedDisplay/EntityEmbedDisplayManager.php
src/EntityEmbedDisplay/EntityEmbedDisplayManager.php
+1
-0
src/EntityEmbedDisplay/FieldFormatterEntityEmbedDisplayBase.php
...tityEmbedDisplay/FieldFormatterEntityEmbedDisplayBase.php
+4
-2
src/Exception/EntityNotFoundException.php
src/Exception/EntityNotFoundException.php
+0
-5
src/Exception/RecursiveRenderingException.php
src/Exception/RecursiveRenderingException.php
+0
-5
src/Form/EntityEmbedDialog.php
src/Form/EntityEmbedDialog.php
+2
-2
src/Plugin/CKEditorPlugin/DrupalEntity.php
src/Plugin/CKEditorPlugin/DrupalEntity.php
+0
-5
src/Plugin/EmbedType/Entity.php
src/Plugin/EmbedType/Entity.php
+1
-6
src/Plugin/Filter/EntityEmbedFilter.php
src/Plugin/Filter/EntityEmbedFilter.php
+1
-3
src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php
...mbed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php
+0
-5
src/Plugin/entity_embed/EntityEmbedDisplay/FileFieldFormatter.php
...in/entity_embed/EntityEmbedDisplay/FileFieldFormatter.php
+0
-5
src/Plugin/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php
...n/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php
+1
-1
src/Tests/EntityEmbedDialogTest.php
src/Tests/EntityEmbedDialogTest.php
+1
-1
src/Tests/EntityEmbedEntityBrowserTest.php
src/Tests/EntityEmbedEntityBrowserTest.php
+1
-5
src/Tests/EntityEmbedHooksTest.php
src/Tests/EntityEmbedHooksTest.php
+3
-0
src/Tests/EntityEmbedTestBase.php
src/Tests/EntityEmbedTestBase.php
+6
-0
src/Tests/EntityEmbedTwigTest.php
src/Tests/EntityEmbedTwigTest.php
+3
-5
src/Tests/EntityReferenceFieldFormatterTest.php
src/Tests/EntityReferenceFieldFormatterTest.php
+3
-0
src/Tests/FileFieldFormatterTest.php
src/Tests/FileFieldFormatterTest.php
+3
-0
src/Tests/ImageFieldFormatterTest.php
src/Tests/ImageFieldFormatterTest.php
+3
-0
tests/fixtures/update/entity_embed.update-hook-test.php
tests/fixtures/update/entity_embed.update-hook-test.php
+4
-0
tests/modules/entity_embed_test/entity_embed_test.module
tests/modules/entity_embed_test/entity_embed_test.module
+0
-1
tests/modules/entity_embed_test/src/EntityEmbedTestTwigController.php
...s/entity_embed_test/src/EntityEmbedTestTwigController.php
+0
-5
No files found.
entity_embed.module
View file @
1bc7daad
...
...
@@ -54,7 +54,9 @@ function taxonomy_entity_embed_display_plugins_alter(array &$plugins) {
*
* The 'Rendered entity' formatter can not be used for files unless the
* file_entity module is available.
*
* @see https://www.drupal.org/node/2468387
*
* @todo Remove when https://www.drupal.org/node/2567919 is fixed in core.
*/
function
entity_embed_entity_embed_display_plugins_for_context_alter
(
array
&
$definitions
,
array
$context
)
{
...
...
src/EntityEmbedBuilder.php
View file @
1bc7daad
src/EntityEmbedBuilderInterface.php
View file @
1bc7daad
src/EntityEmbedDisplay/EntityEmbedDisplayBase.php
View file @
1bc7daad
...
...
@@ -11,7 +11,6 @@ use Drupal\Core\Language\LanguageManagerInterface;
use
Drupal\Core\Plugin\ContainerFactoryPluginInterface
;
use
Drupal\Core\Plugin\PluginBase
;
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\entity_embed
\
EntityEmbedHelperTrait
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
...
...
src/EntityEmbedDisplay/EntityEmbedDisplayInterface.php
View file @
1bc7daad
<?php
/**
* @file
* Contains \Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayInterface.
*/
namespace
Drupal\entity_embed\EntityEmbedDisplay
;
use
Drupal\Component\Plugin\PluginInspectionInterface
;
...
...
src/EntityEmbedDisplay/EntityEmbedDisplayManager.php
View file @
1bc7daad
...
...
@@ -58,6 +58,7 @@ class EntityEmbedDisplayManager extends DefaultPluginManager {
* An array of plugin definitions.
*
* @todo At some point convert this to use ContextAwarePluginManagerTrait
*
* @see https://drupal.org/node/2277981
*/
public
function
getDefinitionsForContexts
(
array
$contexts
=
array
())
{
...
...
src/EntityEmbedDisplay/FieldFormatterEntityEmbedDisplayBase.php
View file @
1bc7daad
...
...
@@ -14,6 +14,9 @@ use Drupal\Core\TypedData\TypedDataManager;
use
Drupal\node\Entity\Node
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
*
*/
abstract
class
FieldFormatterEntityEmbedDisplayBase
extends
EntityEmbedDisplayBase
{
use
PluginDependencyTrait
;
...
...
@@ -234,8 +237,7 @@ abstract class FieldFormatterEntityEmbedDisplayBase extends EntityEmbedDisplayBa
$definition
=
$this
->
formatterPluginManager
->
getDefinition
(
$this
->
getFieldFormatterId
());
$this
->
addDependency
(
'module'
,
$definition
[
'provider'
]);
// @todo Investigate why this does not work currently.
//$this->calculatePluginDependencies($this->getFieldFormatter());
// $this->calculatePluginDependencies($this->getFieldFormatter());
return
$this
->
dependencies
;
}
...
...
src/Exception/EntityNotFoundException.php
View file @
1bc7daad
<?php
/**
* @file
* Contains \Drupal\entity_embed\EntityNotFoundException.
*/
namespace
Drupal\entity_embed\Exception
;
/**
...
...
src/Exception/RecursiveRenderingException.php
View file @
1bc7daad
<?php
/**
* @file
* Contains \Drupal\entity_embed\Exception\RecursiveRenderingException.
*/
namespace
Drupal\entity_embed\Exception
;
/**
...
...
src/Form/EntityEmbedDialog.php
View file @
1bc7daad
...
...
@@ -240,7 +240,7 @@ class EntityEmbedDialog extends FormBase {
'#entity_browser'
=>
$this
->
entityBrowser
->
id
(),
'#cardinality'
=>
1
,
'#entity_browser_validators'
=>
[
'entity_type'
=>
[
'type'
=>
$entity_element
[
'data-entity-type'
]]
'entity_type'
=>
[
'type'
=>
$entity_element
[
'data-entity-type'
]]
,
],
];
}
...
...
@@ -304,7 +304,7 @@ class EntityEmbedDialog extends FormBase {
$form
[
'#title'
]
=
$this
->
t
(
'Review selected @type'
,
array
(
'@type'
=>
$entity
->
getEntityType
()
->
getLowercaseLabel
()));
$form
[
'selection'
]
=
[
'#markup'
=>
$entity
->
label
()
'#markup'
=>
$entity
->
label
()
,
];
$form
[
'actions'
]
=
array
(
...
...
src/Plugin/CKEditorPlugin/DrupalEntity.php
View file @
1bc7daad
<?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\CKEditorPlugin\DrupalEntity.
*/
namespace
Drupal\entity_embed\Plugin\CKEditorPlugin
;
use
Drupal\editor\Entity\Editor
;
...
...
src/Plugin/EmbedType/Entity.php
View file @
1bc7daad
<?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\EmbedType\Entity.
*/
namespace
Drupal\entity_embed\Plugin\EmbedType
;
use
Drupal\Core\Entity\EntityTypeBundleInfoInterface
;
...
...
@@ -179,7 +174,7 @@ class Entity extends EmbedTypeBase implements ContainerFactoryPluginInterface {
'invisible'
=>
[
':input[name="type_settings[entity_browser]"]'
=>
[
'value'
=>
'_none'
],
],
]
]
,
];
$form
[
'entity_browser_settings'
][
'display_review'
]
=
[
'#type'
=>
'checkbox'
,
...
...
src/Plugin/Filter/EntityEmbedFilter.php
View file @
1bc7daad
...
...
@@ -13,8 +13,6 @@ use Drupal\entity_embed\Exception\EntityNotFoundException;
use
Drupal\entity_embed
\
Exception\RecursiveRenderingException
;
use
Drupal\filter\FilterProcessResult
;
use
Drupal\filter\Plugin\FilterBase
;
use
RecursiveArrayIterator
;
use
RecursiveIteratorIterator
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Drupal\embed\DomHelperTrait
;
...
...
@@ -163,7 +161,7 @@ class EntityEmbedFilter extends FilterBase implements ContainerFactoryPluginInte
throw
new
EntityNotFoundException
(
sprintf
(
'Unable to load embedded %s entity %s.'
,
$entity_type
,
$id
));
}
}
catch
(
\
Exception
$e
)
{
catch
(
\
Exception
$e
)
{
watchdog_exception
(
'entity_embed'
,
$e
);
}
...
...
src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php
View file @
1bc7daad
<?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay\EntityReferenceFieldFormatter.
*/
namespace
Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay
;
use
Drupal\entity_embed
\
EntityEmbedDisplay\FieldFormatterEntityEmbedDisplayBase
;
...
...
src/Plugin/entity_embed/EntityEmbedDisplay/FileFieldFormatter.php
View file @
1bc7daad
<?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay\FileFieldFormatter.
*/
namespace
Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay
;
use
Drupal\Core\Form\FormStateInterface
;
...
...
src/Plugin/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php
View file @
1bc7daad
...
...
@@ -110,7 +110,7 @@ class ImageFieldFormatter extends FileFieldFormatter {
if
(
$entity
=
$this
->
getEntityFromContext
())
{
// Loading large files is slow, make sure it is an image mime type before
// doing that.
list
(
$type
,
)
=
explode
(
'/'
,
$entity
->
getMimeType
(),
2
);
list
(
$type
,)
=
explode
(
'/'
,
$entity
->
getMimeType
(),
2
);
$access
=
AccessResult
::
allowedIf
(
$type
==
'image'
&&
$this
->
imageFactory
->
get
(
$entity
->
getFileUri
())
->
isValid
())
// See the above @todo, this is the best we can do for now.
->
addCacheableDependency
(
$entity
);
...
...
src/Tests/EntityEmbedDialogTest.php
View file @
1bc7daad
...
...
@@ -59,7 +59,7 @@ class EntityEmbedDialogTest extends EntityEmbedTestBase {
// $edit = ['attributes[data-entity-id]' => $this->node->id()];
// $this->drupalPostAjaxForm(NULL, $edit, 'op');
// Ensure form structure of the 'embed' step and submit form.
// $this->assertFieldByName('attributes[data-entity-embed-display]', 'Entity Embed Display plugin field is present.');
// $this->assertFieldByName('attributes[data-entity-embed-display]', 'Entity Embed Display plugin field is present.');
.
}
/**
...
...
src/Tests/EntityEmbedEntityBrowserTest.php
View file @
1bc7daad
<?php
/**
* @file
* Contains \Drupal\entity_embed\Tests\EntityEmbedEntityBrowserTest.
*/
namespace
Drupal\entity_embed\Tests
;
use
Drupal\entity_browser
\
Entity\EntityBrowser
;
...
...
@@ -14,6 +9,7 @@ use Drupal\embed\Entity\EmbedButton;
* Tests the entity_embed entity_browser integration.
*
* @group entity_embed
*
* @dependencies entity_browser
*/
class
EntityEmbedEntityBrowserTest
extends
EntityEmbedDialogTest
{
...
...
src/Tests/EntityEmbedHooksTest.php
View file @
1bc7daad
...
...
@@ -16,6 +16,9 @@ class EntityEmbedHooksTest extends EntityEmbedTestBase {
*/
protected
$state
;
/**
*
*/
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
state
=
$this
->
container
->
get
(
'state'
);
...
...
src/Tests/EntityEmbedTestBase.php
View file @
1bc7daad
...
...
@@ -34,6 +34,9 @@ abstract class EntityEmbedTestBase extends WebTestBase {
*/
protected
$node
;
/**
*
*/
protected
function
setUp
()
{
parent
::
setUp
();
...
...
@@ -103,6 +106,9 @@ abstract class EntityEmbedTestBase extends WebTestBase {
return
$file
;
}
/**
*
*/
public
function
assertAvailableDisplayPlugins
(
EntityInterface
$entity
,
array
$expected_plugins
,
$message
=
''
)
{
$plugin_options
=
$this
->
container
->
get
(
'plugin.manager.entity_embed.display'
)
->
getDefinitionOptionsForEntity
(
$entity
);
...
...
src/Tests/EntityEmbedTwigTest.php
View file @
1bc7daad
<?php
/**
* @file
* Contains \Drupal\system\Tests\EntityEmbedTwigTest.
*/
namespace
Drupal\entity_embed\Tests
;
/**
...
...
@@ -14,6 +9,9 @@ namespace Drupal\entity_embed\Tests;
*/
class
EntityEmbedTwigTest
extends
EntityEmbedTestBase
{
/**
*
*/
protected
function
setUp
()
{
parent
::
setUp
();
\
Drupal
::
service
(
'theme_handler'
)
->
install
(
array
(
'test_theme'
));
...
...
src/Tests/EntityReferenceFieldFormatterTest.php
View file @
1bc7daad
...
...
@@ -18,6 +18,9 @@ class EntityReferenceFieldFormatterTest extends EntityEmbedTestBase {
*/
protected
$menu
;
/**
*
*/
protected
function
setUp
()
{
parent
::
setUp
();
...
...
src/Tests/FileFieldFormatterTest.php
View file @
1bc7daad
...
...
@@ -26,6 +26,9 @@ class FileFieldFormatterTest extends EntityEmbedTestBase {
*/
protected
$file
;
/**
*
*/
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
file
=
$this
->
getTestFile
(
'text'
);
...
...
src/Tests/ImageFieldFormatterTest.php
View file @
1bc7daad
...
...
@@ -33,6 +33,9 @@ class ImageFieldFormatterTest extends EntityEmbedTestBase {
*/
protected
$file
;
/**
*
*/
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
image
=
$this
->
getTestFile
(
'image'
);
...
...
tests/fixtures/update/entity_embed.update-hook-test.php
View file @
1bc7daad
<?php
/**
* @file
*/
use
Drupal\Core\Database\Database
;
use
Drupal\Component\Serialization\Yaml
;
...
...
tests/modules/entity_embed_test/entity_embed_test.module
View file @
1bc7daad
...
...
@@ -25,7 +25,6 @@ function entity_embed_test_theme($existing, $type, $theme, $path) {
return
$items
;
}
/**
* Implements hook_entity_embed_display_plugins_alter().
*/
...
...
tests/modules/entity_embed_test/src/EntityEmbedTestTwigController.php
View file @
1bc7daad
<?php
/**
* @file
* Contains \Drupal\entity_embed_test\EntityEmbedTestTwigController.
*/
namespace
Drupal\entity_embed_test
;
/**
...
...
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