Updated: Comment #N

Problem/Motivation

In Drupal\number\Plugin\field\formatter\NumberDecimalFormatter::settingsForm, form elements are not well defined and uses 'weight' instead of '#weight' as parameter, which leds to the following warning message:
weight_warning.png

Proposed resolution

Change 'weight' and use the right parameter '#weight'.

Remaining tasks

User interface changes

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plopesc’s picture

Status: Active » Needs review
FileSize
1.11 KB

Patch

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Looks good :)

plopesc’s picture

plopesc’s picture

Xano’s picture

#4: weight_warning-2114473-3.patch queued for re-testing.

alexpott’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

This means that this form is never ever tested

plopesc’s picture

plopesc’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: weight_warning-2114473-7-only-test.patch, failed testing.

plopesc’s picture

Status: Needs work » Needs review

Back to needs review given that last patch worked.
Regards

plopesc’s picture

The last submitted patch, 11: weight_warning-2114473-11-test-only.patch, failed testing.

swentel’s picture

Status: Needs review » Reviewed & tested by the community
swentel’s picture

+++ b/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php
@@ -189,21 +189,140 @@ function testNumberIntegerField() {
+    //Check number_integer formatter behavior.

Could a core committer add a space here ?

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Love the tests! Committed 5e91589 and pushed to 8.x. Thanks!

Fixed in commit as requested...

diff --git a/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php b/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php
index 2ecd516..4dfe210 100644
--- a/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php
+++ b/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php
@@ -319,7 +319,7 @@ function testNumberFormatter() {
     $this->drupalPostAjaxForm(NULL, $edit, "${integer_field}_plugin_settings_update");
     $this->drupalPostForm(NULL, array(), t('Save'));

-    //Check number_integer formatter behavior.
+    // Check number_integer formatter behavior.
     $this->drupalGet('node/' . $node->id());

     $integer_formatted = number_format($random_integer, 0, '', $thousand_separator);

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.