Metatag field ignores form element #weight.

Created on 8 September 2016, over 8 years ago
Updated 15 April 2025, 13 days ago

Installed a new Drupal 8.1.8, installed Metatag. Went to Article content type, added a field Meta Tags (field_meta_tags). While weight of every other form element can be changed via hook_form_alter() by changing the element's #weight attribute, this does not effect the Metatag field.

<?php

function mymodule_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  $form['field_meta_tags']['#weight'] = -200;
}

?>

I have also tried this with doing this with the form pre-render callback. Setting weight does not effect the field weight.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡¬Bulgaria alexrayu

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024