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 was reading the code for making draggable tables when I saw this...
foreach (Element::children($links) as $id) {
if (isset($links[$id]['#item'])) {
$element = $links[$id];
$form['links'][$id]['#item'] = $element['#item'];
// TableDrag: Mark the table row as draggable.
$form['links'][$id]['#attributes'] = $element['#attributes'];
$form['links'][$id]['#attributes']['class'][] = 'draggable';
$form['links'][$id]['#item'] = $element['#item'];
// TableDrag: Sort the table row according to its existing/configured weight.
$form['links'][$id]['#weight'] = $element['#item']->link->getWeight();
The line $form['links'][$id]['#item'] = $element['#item'];
is duplicated.
Here's a simple patch who remove it.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2652556-remove-duplicate-line-menuform.patch | 683 bytes | Pol |
Comments
Comment #2
PolComment #3
PolComment #4
tstoecklerYup, looks good. Thanks!
Comment #5
catchCommitted/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!