How do I programatically set a duration field value (f.e. on nodes)

Created on 20 July 2020, over 4 years ago
Updated 22 September 2023, over 1 year ago

Hello,

I'm having difficulties setting the value of a duration field programatically. How can this be achieved? I tried the following:

 $node->set('field_duration', ['seconds' => 60]);

However when saving the node the field remains empty.

💬 Support request
Status

Fixed

Version

2.0

Component

Code

Created by

🇳🇱Netherlands steven buteneers

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