Closed loqus closed 1 year ago
Do you have any more of a stack trace you can provide to help narrow down where that error would be coming from? Do you see it when running the migrations or after they're all done?
So what I did was uninstall all non compatible plugins, ran the step by step updating guide. All went well. The front-end shows well. The login page for the cp also works. After logging in I get this error.
I got a little further, I looked into the differences in the composer file from a clean install and the current install. The differences were:
"require-dev": { "yiisoft/yii2-shell": "^2.0.3" },
and
"vlucas/phpdotenv": "^5.4.0",
<= mine was set to a version ^2.4
After updating composer got a new error in the dashboard
Fatal error: Uncaught TypeError: Dotenv\Dotenv::__construct(): Argument #1 ($store) must be of type Dotenv\Store\StoreInterface, string given, called in /web/index.php on line 201 and defined in /vendor/vlucas/phpdotenv/src/Dotenv.php:60 Stack trace: #0 /web/index.php(201): Dotenv\Dotenv->__construct() #1 {main} thrown in /vendor/vlucas/phpdotenv/src/Dotenv.php on line 60
It seems to be coming from these lines in index.php
if (file_exists(CRAFT_BASE_PATH.'/.env')) { (new Dotenv\Dotenv(CRAFT_BASE_PATH))->load(); }
Our recommendations on the entry scripts have been updated a bit in four. I'd recommend checking your configuration against the Craft starter project. Based on the lines you've shared here, you'll at least want to update the index.php
to
// Load dotenv?
if (class_exists(Dotenv\Dotenv::class)) {
// By default, this will allow .env file values to override environment variables
// with matching names. Use `createUnsafeImmutable` to disable this.
Dotenv\Dotenv::createUnsafeMutable(CRAFT_BASE_PATH)->safeLoad();
}
However, I think that might be unrelated to the other issue. Can you run a project-config/apply --force
to see if that clears up your issue? I have a feeling it might be the same issue as #11925
Sounds to me like there was a Git merge conflict on one of your entry types’ project config YAML files at some point (config/project/entryTypes/...
), which wasn’t resolved correctly.
craft\fieldlayoutelements\entries\EntryTitleField
, however that class doesn’t have a fieldUid
property.craft\fieldlayoutelements\CustomField
, which do have a fieldUid
property.I’m not sure why this error wouldn’t show up until your Craft 4 upgrade, as this is all the same code as in Craft 3.
I suspect you could resolve it by running the following command in Craft 3, prior to upgrading:
> php craft project-config/rebuild
Ok I'll try that first before updating.
So I made a copy of the DB and set up a new dev env. Ran the rebuild and got:
PHP Fatal Error 'yii\base\ErrorException' with message 'Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in vendor/yiisoft/yii2/db/Command.php:381'
so it seems it cannot find something it needs
It's a shit load of work, but maybe it's best to re-create the website starting with a blank craft 4 slate. Unless I can somehow easily export and import some things (but most is based on matixes) unless you are going to support v3 forever
Can you try increasing your memory_limit
PHP setting?
I went from 128 to 512 and that seemed to do the trick. I'll try updating to 4 tomorrow
Amazing @brandonkelly @brianjhanson ! With your help it worked out perfectly. Thanks so much.
Glad to hear it!
What happened?
Description
I'm getting a good front-end, but the CP gives: Setting unknown property: craft\fieldlayoutelements\entries\EntryTitleField::fieldUid
Steps to reproduce
Expected behavior
Actual behavior
Craft CMS version
Craft Pro 3.7.55.2 to 4
PHP version
8.0.25
Operating system and version
CentOs 7
Database type and version
MariaDb 10.5.17
Image driver and version
No response
Installed plugins and versions
-