Updated: Comment #N

Problem/Motivation

The changes to values in massageFormValues() do not persist

Proposed resolution

todo - fix it

Remaining tasks

todo

User interface changes

API changes

none

Original report by @pwolanin

related: https://drupal.org/node/2226493

Comments

Wim Leers’s picture

Title: values changes from WidgetBase::massageFormValues() are discarded » Value changes from WidgetBase::massageFormValues() are discarded
Issue summary: View changes
Issue tags: +Entity Field API
Related issues: +#2226493: Apply formatters and widgets to Node base fields, +#2171395: OptionsWidgetBase should use WidgetInterface::massageFormValues()
pwolanin’s picture

Issue summary: View changes
plopesc’s picture

Issue tags: +Field API

Hello,

I tried to reproduce this bug to work on it, maybe I'm missing something :)

In NumberWidget I added the code below:

  public function massageFormValues(array $values, array $form, array &$form_state) {
    foreach($values as &$value) {
      $value['value'] =  2 * $value['value'];
    }
    return $values;
  }

Then I created a node with an integer field, and entering 3 as value in the widget, the value stored in the DB and displayed in the node page was 6. So I think it is working as expected.

Could you point me how to reproduce this bug or tell me what I'm missing, please?

I will try to work on it then.

Thank you!

Berdir’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

Yes, can't confirm this either, we are using this in a custom widget to change the submitted values, works just fine.

Moving this out of the active/major bug queue.

yched’s picture

swentel’s picture

They sound related. Wim hit this during dev days in Szeged and I've been looking along at that time.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Issue tags: +Bug Smash Initiative

Thanks everyone for your contributions on this issue.

As part of the Bug smash initiative, we are triaging issues that are marked 'Postponed (maintainer needs more info)'. This issue is more than 12 months old and no additional information has been provided since the initial replies indicating that contributors were not able to reproduce. As such I am marking it 'Closed (cannot reproduce)'.

If anyone believes this issue should not be closed, please provide specific steps to reproduce when reopening it.