After updating to 3.4 the live preview and live editing mode just displaying the SEOmatic preview
@DavidKabelitz can you try updating to SEOmatic 3.2.41 and see if you have further issues?
I'm also having this issue. It only seems to affect sites upgraded from Craft 3.3, though.
The problem appears to be connected to the Element::EVENT_REGISTER_PREVIEW_TARGETS
event. If, before updating to 3.4, there's a plugin or module registering a custom preview target using that event, it seems like Craft fails to create the default "Primary entry page" preview target when updating to 3.4.
Ahhhhh nice sleuthing @mmikkel -- this makes sense in terms of why we're not always seeing this.
To be clear, it's not only happening w/ SEOMatic – also seeing it happen with other plugins using that event, e.g. SEOMate.
Not really...it still shows the SEOMatic Previews at both links... Share link looks like this: http://localhost/seomatic/preview-social-media?elementId=167418&siteId=1&x-craft-preview=xC9Ry7kuTI&token=RIJU6_5OJ4SL2dMgmyFeWy3UwXVCSX4E
@DavidKabelitz Is this a fresh 3.4 install, or did you upgrade from 3.3?
was a upgrade!
Craft 3.4.0 and 3.4.0.1 had a bug where any custom preview targets would be forgotten as a result of the update. Did you happen to initially update to one of those versions before going to 3.4.0.2? Double-check your section settings and make sure that your preview targets are all in-tact.
Also note that as of 3.4.0, the “Primary entry page” preview target must be explicitly defined by your section’s Preview Targets setting. It won’t show up automatically as it did before.
@brandonkelly Doh, it didn't occur to me that this was due to that same bug. This issue seems resolved when updating from 3.3 straight to 3.4.0.2 👍
Awesome, will go ahead and close this then. For reference, this was originally reported in #5519.
Good morning, no we were updating yesterday from 3.3... to 3.4.0.2. So this will be a issue for all our running craft projects? We are talking about >40 craft instances here...will be a big hussle
@DavidKabelitz do you have a DB backup of a site that you updated from 3.3. to 3.4.0.2 and hit this issue?
If so, can you send over that backup along with your composer.json
and composer.lock
files to [email protected] and make sure to mention this issue in the email?
We have another issue where you requested those files - can you use them? https://github.com/craftcms/cms/issues/5534
Yup, got them. Looking into this now.
@DavidKabelitz hang on. You don't have any preview targets defined for section in that DB backup.
So you're not losing any data that was entered there, just getting hit by the fact that as of 3.4, it has to be explicitly defined?
It depends how it should work correctly. Adding a new section in 3.4 will generate preview targets on its own. Updating from 3.3 will cause that those are all empty. That means that we need edit all section manually. Is that correct? Will cost a lot of time for all projects.
@DavidKabelitz There is a 3.4 migration that will automatically add a new “Primary entry page” preview target to all sections that are enabled for at least one site where entries have a URL format:
So no manually work should be required to maintain old behavior.
ah ok awesome..too late for one project ;)
the migration is causing an error on our site:
Class 'craft\contentmigrations\m190913_152146_update_preview_targets' not found
Try looking in vendor/craftcms/cms/src/migrations/
to see if the file m190913_152146_update_preview_targets.php
exists in there. If not, delete your whole vendor/
folder and then run composer install
.
Before reattempting the update, you will need to restore a database backup that was created before the update.
Thank a lot! I will try it.
Am 30.01.2020 um 23:04 schrieb Brandon Kelly notifications@github.com:
Try looking in vendor/craftcms/cms/src/migrations/ to see if the file m190913_152146_update_preview_targets.php exists in there. If not, delete your whole vendor/ folder and then run composer install.
Before reattempting the update, you will need to restore a database backup that was created before the update.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/craftcms/cms/issues/5535?email_source=notifications&email_token=AGVWNP45CX5L2BX72JHUQO3RANFFJA5CNFSM4KNHXPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKMXOTI#issuecomment-580482893, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGVWNPZY7U5RJAT4ZJPBHYDRANFFJANCNFSM4KNHXPSA.
yes it there!
Am 30.01.2020 um 23:04 schrieb Brandon Kelly notifications@github.com:
Try looking in vendor/craftcms/cms/src/migrations/ to see if the file m190913_152146_update_preview_targets.php exists in there. If not, delete your whole vendor/ folder and then run composer install.
Before reattempting the update, you will need to restore a database backup that was created before the update.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/craftcms/cms/issues/5535?email_source=notifications&email_token=AGVWNP45CX5L2BX72JHUQO3RANFFJA5CNFSM4KNHXPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKMXOTI#issuecomment-580482893, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGVWNPZY7U5RJAT4ZJPBHYDRANFFJANCNFSM4KNHXPSA.
Not sure why PHP would think it’s not, then. Does it have different file permissions compared to other files in the same directory?
Maybe PHP’s file stat cache was just out of date. Try restoring a database backup from before you updated to Craft 3.4, and run the update again.
we fixed it manually…worked out the best and fastest way. Hopefully all other projects will be not that pain.
Ist that just a 3.3. to 3.4 issue?
Am 03.02.2020 um 17:14 schrieb Brandon Kelly notifications@github.com:
Not sure why PHP would think it’s not, then. Does it have different file permissions compared to other files in the same directory?
Maybe PHP’s file stat cache was just out of date. Try restoring a database backup from before you updated to Craft 3.4, and run the update again.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/craftcms/cms/issues/5535?email_source=notifications&email_token=AGVWNPZIZY74TZ5NFMXEYATRBA7HRA5CNFSM4KNHXPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKUNX5Q#issuecomment-581491702, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGVWNP56LMBLF35NDZKH423RBA7HRANCNFSM4KNHXPSA.
What do you mean by that? Always get a little concerned when people don’t let the migrations run normally from a pre-update database backup, as there’s a strong chance that something wasn’t updated correctly.
One strange thing about the error you got, which could be a hint, is that the file _must_ have been present for Craft to know about it (and attempt to load it) in the first place.
Ist that just a 3.3. to 3.4 issue?
It’s never come up before, but highly doubt this is anything 3.4-related. More likely it’s some sort of race condition issue with your environment.
Hi,
manually was needed because the migration script caused just an error page…so it was not working. I commented this already but it was needed to solve this issue as fast as possible..usually i always prefer to use migrations - if those are working ;)
We will keep an eye on it…sorry for all those mails :(
thanks
Am 03.02.2020 um 18:46 schrieb Brandon Kelly notifications@github.com:
What do you mean by that? Always get a little concerned when people don’t let the migrations run normally from a pre-update database backup, as there’s a strong chance that something wasn’t updated correctly.
One strange thing about the error you got, which could be a hint, is that the file must have been present for Craft to know about it (and attempt to load it) in the first place.
Ist that just a 3.3. to 3.4 issue?
It’s never come up before, but highly doubt this is anything 3.4-related. More likely it’s some sort of race condition issue with your environment.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/craftcms/cms/issues/5535?email_source=notifications&email_token=AGVWNP3XUJIIZ5FFVKBKIBTRBBJ7RA5CNFSM4KNHXPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKUX6OA#issuecomment-581533496, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGVWNP4KBLSRFPLMK7QUX5TRBBJ7RANCNFSM4KNHXPSA.
What do you mean by “manually” though? What exactly did you do?
we just add manually values for preview targets cause all were empty…
Just {url} as value… this was the only solution that worked out cause the migration scrip do not worked out.
Am 04.02.2020 um 19:04 schrieb Brandon Kelly notifications@github.com:
What do you mean by “manually” though? What exactly did you do?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/craftcms/cms/issues/5535?email_source=notifications&email_token=AGVWNPY3Z3SRGYGBGPIC3YTRBGUZZA5CNFSM4KNHXPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKYTMWQ#issuecomment-582039130, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGVWNPZMLX5LKRLUV3N3UBDRBGUZZANCNFSM4KNHXPSA.
Gotcha, ok, that’s fine.
@brandonkelly FYI I had this issue on a newer site with Craft 3.5.0 in my initial commit (along with SEOmatic at default settings). I only just noticed it now and came across this thread. Creating a line item under Preview Target set to {url} solved it but figured I'd give you a heads up if this was something intended to be set by default on a fresh install.
@TheFunkyMonk If you created the section while running the Solo edition, then it’s a known issue (#5844).