Hello, I have issue with views node operations bulk form.
I altered node field in hook_views_pre_render(), for example

foreach($view->result as $value){
      kint($value->_entity->get('title')->value);
      $value->_entity->set('title', 'test - ' . time());
}

After I use some Action from views operations bulk form (for example 'Publish Content') , node title value ('test - ' . time()) is saved to the node. So I just wanted to change status of node but instead of this I override title of the node.
I believe it's a bug or I incorrectly set the value in hook_views_pre_render(). Do you can help me? Thanks.

Comments

pikas created an issue. See original summary.

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.

Lendude’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry but it's unclear to me what you are trying to accomplish.

$value->_entity->set('title', 'test - ' . time());
I'm not surprised that the title would get overwritten if you do that.

But hook_views_pre_render sounds like a bad place to set anything in the rendered entities really....

Can you be clearer in what your goal is?

pikas’s picture

My goal is just override title (or another field) in views results but without saving it to node.