A website Iām developing is suffering from a really strange issue. Essentially it causes the panel to save a page in the wrong language file.
Itās rather complicated to reproduce and this doesnāt help debugging. But itās definitely there and affects multiple installations and browsers. It affects at least 2.3.2 and 2.4.0.
Hereās a video of what happens:
Notice how kirby widly changes the language, saving the āenglishā text to the āgermanā page. (Iāve checked and it really saves the content to the wrong file).
It seems to happen somewhat consistently (but not everytime) on blueprints that use the ātabsā plugin (by @ahmetbora) together with an āimageā field. But because of the difficulties with reproducing this bug I canāt be sure this really matters.
Anyway, here are the steps needed to reproduce it āmost of the timesā. Iāve put together a script to help setup a test environment.
If you are on an environment with the Kirby CLI, the āunzipā and āwgetā command line utilities, you can use this script in an empty folder:
kirby install test --kit langkit
cd test
wget https://github.com/afbora/Kirby-Tabs-Field/archive/master.zip
unzip master.zip
mkdir site/fields
mv Kirby-Tabs-Field-master/ site/fields/tabs
rm master.zip
cat >site/blueprints/test.yml <<EOL
title: Test
pages: false
files: true
fields:
tab1:
label: General
type: tabs
title:
label: Title
type: text
tab2:
label: Details
type: tabs
image:
label: Image
type: image
EOL
mkdir content/test
cat >content/test/test.en.txt <<EOL
Title: test en
----
Image:
EOL
cat >content/test/test.de.txt <<EOL
Title: test de
----
Image:
EOL
php -S localhost:3000
This just downloads a starterkit, installs the tabs plugin, creates a blueprint and starts a server.
Yeah, it really seems like itās something with the Tabs plugin and image fields. But I donāt know enough about the inner workings of the panel to even imagine what could be going wrong.
Another strange thing is that āthe switched languageā stays there only for a āmomentā, you can try it out by refreshing the page (Ctrl+R) when you see that the panel is on the wrong language and it will switch back. Itās like the session keeps the right language, but somehow, sometimes, the panel doesnāt use the language provided from the session. Which is even stranger because the āajax save callsā in the panel, do not seem to contain any info about which language is being saved.
Anyway, a fast to implement work-around for people having the bug related to Tabs + Image field is replacing the image with the āselectorā field plugin. This seemed to help here, at least with my empiric testing methods.
Do you think that adding a hidden input with name language (via plugin) to the blueprints, that always has the āright / currentā language would work around the problem? This should kind of āresetā to the right language on each save.
Iām aware that this is more a hack than a fix, but until 2.5 comes around it could be a solutionā¦
Hi there,
we are experiencing the same problem and it drives our editors nuts. Questions about the CMS choice are also noticeable .
We are experiencing this bug constantly. I have not installed the Tabs plugin. But we have a image selection field in the blueprint. I would highly appreciate if you could look into this bug. So it is on the 2.5 milestones list. If you need a beta test, I am happy to help, of course!
I still have this bug on my multilanguage websites (Kirby 2.5.5)
Iāve lost all my homepage traduction this morning :-/
This bug is very weird because it doesnāt happen every time we save a page.
Iāve read in the Kirby 2.5.6 changelog, in the Panel section (5th bullet point) :
āEnsure that content is saved in the correct languageā
The code that should have fixed this issue was removed again from the final releaseā¦because it caused another issue. As a temporary workaround you could apply the original fix, but prefix the special language field to avoid this issue.
I encounter a similar issue. Two language website, no plugin, editor have an unpredictable behaviour.
When trying to save in the main language, sometime it switch to the secondary language without saving. Sometime it save in the wrong language, erasing the translation. Kirby/Toolkit/Panel 2.5.6. Sometime it simply lost the fields that were intended to be saved.
Very, very annoying problem as I could not ship the website with such a problem.
I applied the temporary workaround suggested by texnixe. Seems to correct the problem for now.
I did not understood either for the prefix (i prefixed $languageFieldā¦).
Switching to a correctly prefixed version seems to bring back the problem.
As the issue that led to the removal of the code fixing this problem seems to be related to user edition, I would temporarily remove the code when editing users, but for the moment Iāll use the unprefixed version, as my problem for now is allowing the client to input data.