public function Node::getBundleFormSubmitHandlerAttachLocations in Rabbit Hole 2.x
Same name and namespace in other branches
- 8 modules/rh_node/src/Plugin/RabbitHoleEntityPlugin/Node.php \Drupal\rh_node\Plugin\RabbitHoleEntityPlugin\Node::getBundleFormSubmitHandlerAttachLocations()
Return locations to attach submit handlers to entity bundle form.
This should return an array of arrays, e.g.: [ ['actions', 'submit', '#publish'], ['actions', 'publish', '#submit'], ].
Return value
array A multidimensional array.
Overrides RabbitHoleEntityPluginBase::getBundleFormSubmitHandlerAttachLocations
File
- modules/
rh_node/ src/ Plugin/ RabbitHoleEntityPlugin/ Node.php, line 22
Class
- Node
- Implements rabbit hole behavior for nodes.
Namespace
Drupal\rh_node\Plugin\RabbitHoleEntityPluginCode
public function getBundleFormSubmitHandlerAttachLocations(array $form, FormStateInterface $form_state) {
if (\Drupal::moduleHandler()
->moduleExists('field_ui') && $form_state
->getFormObject()
->getEntity()
->isNew()) {
return [
[
'actions',
'save_continue',
'#submit',
],
];
}
return parent::getBundleFormSubmitHandlerAttachLocations($form, $form_state);
}