Double remove button but one is false remove button

Created on 16 February 2024, 12 months ago
Updated 27 May 2024, 8 months ago

Problem/Motivation

When I edit in administration form a field with multiple social links it show me 2 delete buttons one is correct that is the one in social_link_field/src/Plugin/Field/FieldWidget/SocialLinkWidget.php but the other is like add media when you click but I dont know
why is there and where is implemented in code.

I add screen capture of 2 remove buttons (second one is the problem , the first one is the good one)

The code of all table inspecting it in html is (search input by the end for data-drupal-selector="edit-field-social-networks-0-actions-delete"):

<tr class="draggable odd" data-once="claroTabledrag">
                      <td class="field-multiple-drag tabledrag-cell tabledrag-cell--only-drag"><div class="tabledrag-cell-content js-tabledrag-cell-content"><a href="#" title="Arrastre para reordenar" class="tabledrag-handle js-tabledrag-handle"></a><div class="tabledrag-cell-content__item"></div></div></td>
                      <td>

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'form_element' -->
<!-- FILE NAME SUGGESTIONS:
   * form-element--select.html.twig
   * form-element--select.html.twig
   * form-element--edit-field-social-networks-0-social--ZvOPUuTgKhU.html.twig
   x form-element.html.twig
-->
<!-- BEGIN OUTPUT from 'themes/contrib/gin/templates/form/form-element.html.twig' -->
<div class="js-form-item form-item js-form-type-select form-type--select js-form-item-field-social-networks-0-social form-item--field-social-networks-0-social">
            

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'form_element_label' -->
<!-- BEGIN OUTPUT from 'core/themes/claro/templates/form-element-label.html.twig' -->
<label for="edit-field-social-networks-0-social--ZvOPUuTgKhU" class="form-item__label">Social network <span class="translation-entity-all-languages">(todos los idiomas)</span></label>
<!-- END OUTPUT from 'core/themes/claro/templates/form-element-label.html.twig' -->


              

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'select' -->
<!-- BEGIN OUTPUT from 'core/modules/system/templates/select.html.twig' -->
<select data-drupal-selector="edit-field-social-networks-0-social" id="edit-field-social-networks-0-social--ZvOPUuTgKhU" name="field_social_networks[0][social]" class="form-select form-element form-element--type-select" data-once="drupal-ajax"><option value="" selected="selected">- Seleccionar -</option><option value="resid">Resid</option><option value="gscholar">Gscholar</option><option value="resgate">Resgate</option><option value="flickr">Flickr</option><option value="mendeley">Mendeley</option><option value="facebook">Facebook</option><option value="linkedin">LinkedIn</option><option value="vimeo">Vimeo</option><option value="tiktok">TikTok</option><option value="instagram">Instagram</option><option value="youtube">Youtube Channel</option><option value="mastodon">Mastodon</option><option value="twitter">X (Twitter)</option></select>
<!-- END OUTPUT from 'core/modules/system/templates/select.html.twig' -->


          </div>

<!-- END OUTPUT from 'themes/contrib/gin/templates/form/form-element.html.twig' -->

<div id="vpFfGyd2DKKyFJEJsWVuOT3Lg4v6Y6YOZdtR9rzyDDU-0-link-wrapper">

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'form_element' -->
<!-- FILE NAME SUGGESTIONS:
   * form-element--textfield.html.twig
   * form-element--textfield.html.twig
   * form-element--edit-field-social-networks-0-link--e1sG4JDPtQQ.html.twig
   x form-element.html.twig
-->
<!-- BEGIN OUTPUT from 'themes/contrib/gin/templates/form/form-element.html.twig' -->
<div class="js-form-item form-item js-form-type-textfield form-type--textfield js-form-item-field-social-networks-0-link form-item--field-social-networks-0-link">
            

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'form_element_label' -->
<!-- BEGIN OUTPUT from 'core/themes/claro/templates/form-element-label.html.twig' -->
<label for="edit-field-social-networks-0-link--e1sG4JDPtQQ" class="form-item__label">Profile link <span class="translation-entity-all-languages">(todos los idiomas)</span></label>
<!-- END OUTPUT from 'core/themes/claro/templates/form-element-label.html.twig' -->

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'input__textfield' -->
<!-- FILE NAME SUGGESTIONS:
   * input--textfield.html.twig
   * input--edit-field-social-networks-0-link--e1sG4JDPtQQ.html.twig
   x input.html.twig
-->
<!-- BEGIN OUTPUT from 'core/themes/claro/templates/form/input.html.twig' -->
<input data-drupal-selector="edit-field-social-networks-0-link" type="text" id="edit-field-social-networks-0-link--e1sG4JDPtQQ" name="field_social_networks[0][link]" value="" size="60" maxlength="128" class="form-text form-element form-element--type-text form-element--api-textfield">
<!-- END OUTPUT from 'core/themes/claro/templates/form/input.html.twig' -->

          </div>

<!-- END OUTPUT from 'themes/contrib/gin/templates/form/form-element.html.twig' -->

</div>

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'container' -->
<!-- FILE NAME SUGGESTIONS:
   * container--actions.html.twig
   * container--has-parent.html.twig
   x container.html.twig
-->
<!-- BEGIN OUTPUT from 'core/modules/system/templates/container.html.twig' -->
<div data-drupal-selector="edit-field-social-networks-0-actions" class="form-actions js-form-wrapper form-wrapper" id="edit-field-social-networks-0-actions--VLcGRhEeD3Y">

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'input__submit' -->
<!-- FILE NAME SUGGESTIONS:
   * input--submit.html.twig
   * input--edit-field-social-networks-0-actions-remove-button--JKDbAvrkmIY.html.twig
   x input.html.twig
-->
<!-- BEGIN OUTPUT from 'core/themes/claro/templates/form/input.html.twig' -->
<input data-drupal-selector="edit-field-social-networks-0-actions-remove-button" formnovalidate="formnovalidate" type="submit" id="edit-field-social-networks-0-actions-remove-button--JKDbAvrkmIY" name="field_social_networks_0_remove_button" value="Eliminar" class="button js-form-submit form-submit" data-once="drupal-ajax">
<!-- END OUTPUT from 'core/themes/claro/templates/form/input.html.twig' -->

</div>

<!-- END OUTPUT from 'core/modules/system/templates/container.html.twig' -->

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'input__submit' -->
<!-- FILE NAME SUGGESTIONS:
   * input--submit.html.twig
   * input--edit-field-social-networks-0-actions-delete--zGr9uOPTq9s.html.twig
   x input.html.twig
-->
<!-- BEGIN OUTPUT from 'core/themes/claro/templates/form/input.html.twig' -->
<input data-drupal-selector="edit-field-social-networks-0-actions-delete" formnovalidate="formnovalidate" type="submit" id="edit-field-social-networks-0-actions-delete--zGr9uOPTq9s" name="field_social_networks_0_remove_button" value="Eliminar" class="button js-form-submit form-submit" data-once="drupal-ajax">
<!-- END OUTPUT from 'core/themes/claro/templates/form/input.html.twig' -->

</td>
                      <td class="delta-order tabledrag-hide" style="display: none;">

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'form_element' -->
<!-- FILE NAME SUGGESTIONS:
   * form-element--select.html.twig
   * form-element--select.html.twig
   * form-element--edit-field-social-networks-0-weight--cA-1ua5oaYo.html.twig
   x form-element.html.twig
-->
<!-- BEGIN OUTPUT from 'themes/contrib/gin/templates/form/form-element.html.twig' -->
<div class="js-form-item form-item js-form-type-select form-type--select js-form-item-field-social-networks-0--weight form-item--field-social-networks-0--weight form-item--no-label">
            

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'form_element_label' -->
<!-- BEGIN OUTPUT from 'core/themes/claro/templates/form-element-label.html.twig' -->
<label for="edit-field-social-networks-0-weight--cA-1ua5oaYo" class="form-item__label visually-hidden">Peso para la fila 1 <span class="translation-entity-all-languages">(todos los idiomas)</span></label>
<!-- END OUTPUT from 'core/themes/claro/templates/form-element-label.html.twig' -->
 

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'select' -->
<!-- BEGIN OUTPUT from 'core/modules/system/templates/select.html.twig' -->
<select data-drupal-selector="edit-field-social-networks-0-weight" class="field_social_networks-delta-order form-select form-element form-element--type-select" id="edit-field-social-networks-0-weight--cA-1ua5oaYo" name="field_social_networks[0][_weight]"><option value="0" selected="selected">0</option></select>
<!-- END OUTPUT from 'core/modules/system/templates/select.html.twig' -->


          </div>

<!-- END OUTPUT from 'themes/contrib/gin/templates/form/form-element.html.twig' -->

</td>

Steps to reproduce

I use drupal 10.2.3 and last 2.x-dev version of social link field

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇪🇸Spain jcarrasco

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024