Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix D8 Plugins construction. #73

Merged
merged 2 commits into from
Jun 24, 2015
Merged

Fix D8 Plugins construction. #73

merged 2 commits into from
Jun 24, 2015

Conversation

drupol
Copy link
Collaborator

@drupol drupol commented Jun 23, 2015

Make sure that $configuration, $plugin_id and $plugin_definition are passed to a plugin.

@drupol drupol self-assigned this Jun 24, 2015
@drupol drupol added this to the 1.0.0 milestone Jun 24, 2015
@@ -63,6 +63,7 @@ public function createInstance($plugin_id, array $configuration = array()) {
'arguments' => array(),
);

array_unshift($plugin_definition['arguments'], $this->getDefinition($plugin_id));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not call getDefinition twice.

Just use:

$plugin_definition_copy = $plugin_definition = $this->getDefinition($plugin_id);
$plugin_definition += array(
       'arguments' => array(),
     );

array_unshift($plugin_definition['arguments'], $plugin_definition_copy);
array_unshift($plugin_definition['arguments'], $plugin_id);

LionsAd added a commit that referenced this pull request Jun 24, 2015
@LionsAd LionsAd merged commit 4812cf9 into LionsAd:7.x-1.x Jun 24, 2015
@drupol drupol deleted the Fix-Plugins-Construction branch June 24, 2015 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants