Update to Drupal 8.0.5. For more information, see https://www.drupal.org/node/2679347

This commit is contained in:
Pantheon Automation 2016-03-02 12:40:24 -08:00 committed by Greg Anderson
parent 2a9f1f148d
commit fd3b12cf27
251 changed files with 5439 additions and 957 deletions

View file

@ -9,6 +9,14 @@ namespace Drupal\Core\Menu;
/**
* Defines a contextual link plugin.
*
* Contextual links by default are in the module_name.links.contextual.yml
* file. These YAML files contain a list of contextual link plugin definitions,
* keyed by the plugin ID. Each definition must define a route_name and a group
* and might define title, options, and weight. See the getter methods on this
* interface for an explanation of each.
*
* @ingroup menu
*/
interface ContextualLinkInterface {

View file

@ -110,6 +110,10 @@ class MenuLinkDefaultForm implements MenuLinkFormInterface, ContainerInjectionIn
'#type' => 'item',
'#title' => $this->t('This link is provided by the @name module. The title and path cannot be edited.', array('@name' => $this->moduleHandler->getName($provider))),
);
$form['id'] = array(
'#type' => 'value',
'#value' => $this->menuLink->getPluginId(),
);
$link = array(
'#type' => 'link',
'#title' => $this->menuLink->getTitle(),
@ -158,7 +162,11 @@ class MenuLinkDefaultForm implements MenuLinkFormInterface, ContainerInjectionIn
* {@inheritdoc}
*/
public function extractFormValues(array &$form, FormStateInterface $form_state) {
$new_definition = array();
// Start from the complete, original, definition.
$new_definition = $this->menuLink->getPluginDefinition();
// Since the ID may not be present in the definition used to construct the
// plugin, add it here so it's available to any consumers of this method.
$new_definition['id'] = $form_state->getValue('id');
$new_definition['enabled'] = $form_state->getValue('enabled') ? 1 : 0;
$new_definition['weight'] = (int) $form_state->getValue('weight');
$new_definition['expanded'] = $form_state->getValue('expanded') ? 1 : 0;

View file

@ -38,7 +38,8 @@ interface MenuLinkFormInterface extends PluginFormInterface {
* The current state of the form.
*
* @return array
* The new plugin definition values taken from the form values.
* The new plugin definition values taken from the form values. The plugin
* ID must be returned as part of the definition.
*/
public function extractFormValues(array &$form, FormStateInterface $form_state);