craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.22k stars 626 forks source link

[4.x]: Loosing Field Values #12998

Closed DavidKabelitz closed 1 year ago

DavidKabelitz commented 1 year ago

What happened?

Description

I have an issue at a couple of Craft 4 projects. Both are different but maybe they belong.

Some fields loose randomly the default value. Most of them are DropDowns. It's needed to set the default value back on at the settings. Another problem is loosing data from fields while adding an entry. We have tabs with different fields, categories, tags, dropdowns and so on. While adding an entry we need to fill fields mostly two times because values are lost after the first attempt of adding the entry.

Steps to reproduce

1.

Expected behavior

Actual behavior

Craft CMS version

Craft Pro 4.4.5

PHP version

8+

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

-

jonleverrier commented 1 year ago

I've noticed strangeness with dropdown fields and default values since 4.4. Here's an issue I reported with a dropdown field and commerce https://github.com/craftcms/commerce/issues/3115#issuecomment-1470886328

i-just commented 1 year ago

@DavidKabelitz Hi, thanks for reaching out. I can’t replicate this behaviour, so I have a few questions.

Some fields loose randomly the default value. Most of them are DropDowns. It's needed to set the default value back on at the settings.

Another problem is loosing data from fields while adding an entry. We have tabs with different fields, categories, tags, dropdowns, etc. While adding an entry we need to fill fields mostly two times because values are lost after the first attempt of adding the entry.

@jonleverrier I can’t replicate the issue you raised with Commerce on the CMS, and I can see it was fixed within Commerce.

DavidKabelitz commented 1 year ago

It's the same issue like @jonleverrier describes. yaml files are changing on its own and changed some drop downs to what he described: null or label N/A. I see lot's of yaml files are changed at different environments without a change or push from our side.

So it's happening randomly without a direct push before, usually we recognized it while adding or editing content. It feels it always related to the process of saving something and usually creating a new entry instead of editing a new one.

Related to the second one, yes always first save. Because those fields are mandatory fields it just displays the normal error message, nothing else.

i-just commented 1 year ago

Thanks for more info.

I see lot's of yaml files are changed at different environments without a change or push from our side.

Do you have allowAdminChanges disabled in all environments except development?

Could you please share a list of plugins you’re using?

DavidKabelitz commented 1 year ago

At the moment at all enviroments allowAdminChanges is on true. Those are also not updated from 3 ones, we started them from scratch with Craft 4.

Could you please share a list of plugins you’re using?

Sure here is the list, it's a lot because we created a website builder that is used for a couple of projects:

"craftcms/cms": "4.4.5",
"craftcms/redactor": "3.0.4",
"nystudio107/craft-imageoptimize": "4.0.4",
"nystudio107/craft-minify": "4.0.0-beta.2",
"nystudio107/craft-retour": "4.1.11",
"nystudio107/craft-seomatic": "4.0.22",
"nystudio107/craft-similar": "4.0.0",
"nystudio107/craft-typogrify": "4.0.1",
"ostark/craft-async-queue": "3.1.0",
"putyourlightson/craft-blitz": "4.4.3",
"sebastianlenz/linkfield": "2.1.5",
"utakka/redactor-anchors": "1.4.1",
"vaersaagod/dospaces": "2.0.0",
"verbb/formie": "2.0.25.1",
"verbb/navigation": "2.0.17",
"verbb/super-table": "3.0.7",
"verbb/vizy": "2.0.12",
"vlucas/phpdotenv": "v5.4.1",
"wrav/oembed": "2.3.0",
"yiisoft/yii2-redis": "~2.0.0"
i-just commented 1 year ago

Perfect, thank you!

The first thing you should do is review the steps here: https://craftcms.com/docs/4.x/project-config.html. For the project config to work as expected, you need allowAdminChanges to be set to false everywhere except your dev environment. If that doesn’t fix your issues, please let me know.

DavidKabelitz commented 1 year ago

ok but that makes not much sense for us, especially when we work local on a project to finish content. Even when this helps for Stage and Production, how will it remove the problems locally? After launching a project those are set to false, but this is just a workaround and not a solution. I don't get it.

i-just commented 1 year ago

OK, maybe I’m misunderstanding some of what you described. To simplify this issue, let’s discuss what’s happening with just the dev environment.

You are experiencing the issues you described in the dev environment. The dropdown default values are randomly lost on saving an entry without changing the field (via project-config/apply or manual edit via settings > fields)?

DavidKabelitz commented 1 year ago

You are experiencing the issues you described in the dev environment.

Yes at local and stage but both had "allowadminchanges" on, so not much difference between stage and dev. Some projects we fully finish on local, so needs to work even at dev environment.

i-just commented 1 year ago

Could you please send your composer.json, composer.lock, config/project and database export to support@craftcms.com so we can try to replicate it and dig deeper?

DavidKabelitz commented 1 year ago

Sure i will do it, thanks for that

DavidKabelitz commented 1 year ago

@i-just message was blocked of your email server cause of the config files.

i-just commented 1 year ago

Does it still get blocked if you zip it all up?

DavidKabelitz commented 1 year ago

yes tried it two times, all in zip files... i will use wetransfer ok?

DavidKabelitz commented 1 year ago

hm even wetransfer blocked the database dump to send...crazy...so it worked with two parts. Composer and Config files via wetransfer and db with email