craftcms/cms

[5.x]: 0 added to all empty fields

funkysoul opened this issue · 4 comments

What happened?

Description

Since upgrading to 5.2.0 every empty field in the CMS itself receives a 0 resulting in saving the 0 in unwanted places
I've noticed that while upgrading to 5.2.x the Yii Framework got updated too. (see attachment) – i assume it could have something with the "new" way they handle "select()"

Steps to reproduce

  1. Update to 5.2.0
  2. not much done else

Expected behavior

  1. well don't save empty fields as "0" ;-)

Actual behavior

Screenshot 2024-06-19 at 14 52 56

CraftCMS 5.1.10
5 1 10

CraftCMS 5.2.x
5 2 x

Craft CMS version

5.2.X

PHP version

8.3

Operating system and version

OSX 14.5 (Sonoma)

Database type and version

MySQL 8.x

Image driver and version

No response

Installed plugins and versions

Doesnt matter if there are plugins or not.. (i've removed all plugins to test)

I’m not able to reproduce. Can you provide more details?

  • What specific version of Craft are you using?
  • What version did you update from? (Was it 5.1.0?)
  • Do you have any plugins and/or custom modules installed?
  • Currently Using 5.1.10 (as its the one that doesnt have that effect)
  • I've updated originally from 5.1.1 (but project was setup with 5.0.0)
  • Nope

We found a site where we can reproduce this. Looks like it started in 5.2.0-beta.1. Looking into it…

Tracked this down to an unreleased Yii change (yiisoft/yii2#20198). I’ve replied to the PR requesting them to revert since it’s a breaking change.

Since it’s unreleased, the only way you’d be affected by it is if yiisoft/yii2 is getting pulled in at dev-master rather than the latest stable 2.0.50.x release. That can happen if you have minimum-stability set to dev in composer.json, but not prefer-stable: true. To fix, add the following line to composer.json:

"prefer-stable": true,

Then run composer update.