Closed tritos-design closed 2 years ago
@tritos-design I couldn't reproduce the issue.
@afbora Yes, the same happens with the latest starterkit (3.6.2). I only made one modification in site/blueprints/pages/note.yml from
columns:
- width: 2/3
# This columns only has a single field
fields:
text:
type: blocks
to
columns:
- width: 2/3
# This columns only has a single field
fields:
w1:
type: writer
w2:
type: writer
text:
type: blocks
Then I start the php built-in verser via php -S localhost:8000 kirby/router.php
, go to http://localhost:8000/panel/pages/notes+exploring-the-universe
add the text qwe
to w1 and asd
to w2 and save the changes.
Then I click the page title and change the slug from exploring-the-universe
to exploring-the-universe2
.
Result: The orange change/revert bar appears and the content of the second writer field w2
has disappeared.
I can get the content back by clicking revert
, but it shouldn't disappear in the first place.
Can you reproduce this?
P.S.: I'm running PHP 8.0.16 locally, if that might be relevant.
Can you reproduce this?
Nope 🤷♂️
https://user-images.githubusercontent.com/3393422/155997096-97f49aef-f466-4e7e-9e9a-31fea6660991.mp4
OK, this leaves me confused. I have no idea. I just repeated the process and literally grabbed the latest starterkit from github, adjusted note.yml and the result is again the error in Firefox and Chromium.
Thanks for tests. I have no idea either. May be related with browser or local setup configurations.
May I ask you to try one last thing? Can you reproduce the same issue in 3.5.8, 3.6.0 or 3.6.1? Maybe that can give us a clue if we find out which one worked last.
I did some more testing and I can confirm that the issue was introduced in 3.6.2. It's working fine in 3.6.1.
Edit: The error also occurs in 3.5.8, but not in 3.6.0 and 3.6.1. Was something introduced in 3.6.0 and removed in 3.6.2?
I just tested this as well with a freshly cloned Starterkit in my environment and can reproduce the issue.
Tested with Kirby 3.6.2, Firefox 97.0.1 (64-Bit), MacBook Pro with MacOS Monterey 12.1, and Valet with PHP 8.0.15 with Opcache extension enabled.
When I disable Opcache, this doesn't happen.
@texnixe you know better. Could it be because of that? https://getkirby.com/docs/guide/troubleshooting/panel#opcache-server-side-caching-in-general
@afbora I don't know. I was just testing and saw that you couldn't reproduce it while I could. So I had a closer look at my settings (didn't even know that Opcache was enabled, because I usually disable it so as not to run into such issues).
@afbora It might really be due to opcache. Thanks for finding out, @texnixe. Further test results: On a web server (Mittwald) the setting "Performance+" clearly has some influence. When it's turned on, the issue always occurs. When it's turned off, the issue doesn't occur. According to Mittwald "Performance+" activates opcache and apcu (see here https://www.mittwald.de/faq/administration/php/performance-plus; unfortunately only in German). Locally, I tried disabling opcache, but it had no effect there, even though I confirmed that opcache was off via phpinfo(). However, this might be due to my local settings, I wouldn't bother about that too much.
For the time being, I can disable opcache on the server which is fine for now (the customer changes slugs quite frequently during development), but as a long-term solution it would be nice to identify and eliminate the root cause.
It's good that we found clues. So, for a permanent solution, did you apply the solutions in this article? https://getkirby.com/docs/guide/troubleshooting/panel#opcache-server-side-caching-in-general
Yes, I tried these suggestions, but they had no effect on the issue. Sounds like this issue will be hard or impossible to solve in he core, if I understand correctly, right?
The @getkirby/kirby-staff should decide how to approach this opcache-related issue.
I wonder why this is related to OPcache. It only caches PHP files, but not text files or YAML blueprints...
I think this still needs needs: replication
and less discussion. I agree with @lukasbestle that I'm not yet sure it's due to opcache.
@tritos-design The Mittwald docs also say that Performance Plus uses PHP FPM (FastCGI Process Manager). This alone shouldn't cause this issue either, but it suggests to me that the whole server setup might be different with the option enabled. If they say that they use FPM for Performance Plus, what do they use in the non-Performance Plus mode? This makes it quite hard to find a clear difference and source of the issue.
@lukasbestle I agree that this is somehow a strange issue, but at least for @texnixe it seems to be triggered by just turning opcache on/off. I'm afraid, I cannot contribute much more at this point. Would a phpinfo() for the cases with/without "Performance Plus" be of any help?
To be honest I'm not an expert in the inner workings of the writer field. I suspect something is going on about the localStorage
, but I can't tell for sure. @distantnative @bastianallgeier?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
Description
Precondition: Two writer fields in a single blueprint (there may be more than these two fields); both fields are filled with some data and saved When changing the page's slug, the content of the second writer field is deleted and the orange save/dismiss bar appears. When saving, the content of the second writer field is written to disk as empty. When dismissing, the original content is restored.
Expected behavior
The content of the second writer field should not be deleted.
To reproduce
1) Create a blueprint with at least two writer fields. 2) Save some arbitrary data in the writer fields. 3) Change the page slug. 4) See that the content of the second writer field has been deleted.
Your setup
Kirby Version
3.6.2
Console output
No errors logged.
Your system (please complete the following information) Seen across different browsers (Firefox, Chrome) and different systems (Linux, Windows).