Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I think there are bunch of code need to be removed from 8.x branch for clarity reasons.
Reading through code would never stepped into is very time consuming and misleading.
example:
/**
* Clones a node - prepopulate a node editing form
*/
function node_clone_node_prepopulate($original_node) {
if (isset($original_node->nid)) {
if (node_clone_is_permitted($original_node->type)) {
$node = _node_clone_node_prepare($original_node, TRUE);
// @FIXME
// drupal_set_title() has been removed. There are now a few ways to set the title
// dynamically, depending on the situation.
//
//
// @see https://www.drupal.org/node/2067859
// drupal_set_title($node->title);
// Let other modules do special fixing up.
$context = array('method' => 'prepopulate', 'original_node' => $original_node);
\Drupal::logger('probe')->notice("I bet this is never called");
\Drupal::moduleHandler()->alter('node_clone_node', $node, $context);
// Make sure the file defining the node form is loaded.
$form_state = array();
$form_state['build_info']['args'] = array($node);
$form_state->loadInclude('node', 'inc', 'node.pages');
return \Drupal::formBuilder()->buildForm($node->type .'_node_form', $form_state);
}
}
}
Comments