Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multilanguage: UI broken after saving page + file extension broken when saving page in second language: default.md.fr.md #2282

Open
pamtbaau opened this issue May 18, 2022 · 12 comments
Assignees

Comments

@pamtbaau
Copy link

pamtbaau commented May 18, 2022

When saving a new page in a multi-lingual site, the Admin UI is broken.

Steps to reproduce:

  • Create a fresh install from zip with Grav 1.7.33. + Admin

  • Open Admin

  • Create new page and save: All is well
    Untitled

  • Add languages en and fr in Configuration panel

  • Create new page and save: Faulty page layout
    Untitled

  • Save current page as second language: Page throws error
    Untitled

  • Inspect the filesystem: Faulty file extension

    user/pages/
    ├── 01.home
    │   └── default.md
    ├── 02.typography
    │   └── default.md
    ├── 03.pageone
    │   └── default.md
    └── 04.pagetwo
        ├── default.en.md
        └── default.md.fr.md         <-- Note the file extension
    
@k8n
Copy link

k8n commented May 18, 2022

Perhaps this is caused by an outdated version of the Admin plugin. I'm running with v1.10.27 against Grav 1.7.33 and experiencing the same. @pamtbaau, what version of Admin are you experiencing this with?

Also saving a content item into another language (e.g. English item being saved as French) caused superfluous suffix added to the markdown file resulting in item.en.md.fr.md.

@pamtbaau
Copy link
Author

pamtbaau commented May 19, 2022

I did my tests on a fresh install of the latest versions: Grav 1.7.33 + Admin 1.10.33.1.

This is weird. Created another fresh install and saving the page in the first language return a correct UI and saving the page in second language gives an error because of a faulty file extension: default.md.fr.md

I've update my initial post

@pamtbaau pamtbaau changed the title UI broken when adding pages in multilingual site Multilanguage: UI broken after saving page + broken file extension: default.md.fr.md May 19, 2022
@pamtbaau pamtbaau changed the title Multilanguage: UI broken after saving page + broken file extension: default.md.fr.md Multilanguage: UI broken after saving page May 19, 2022
@pamtbaau pamtbaau changed the title Multilanguage: UI broken after saving page Multilanguage: UI broken after saving page + file extension broken when saving page in second language: default.md.fr.md May 19, 2022
@pamtbaau
Copy link
Author

After some more tests, it seems to be a Grav core issue and not Admin.

  • Installed from zip latest Grav 1.7.33 + Admin
  • Downgraded Admin to earlier version
  • Admin shows issues

  • Installed from zip Grav 1.7.32 + Admin
  • All goes well
  • Upgraded Grav to 1.7.33 (not the plugins)
  • Admin shows issues

Looking at the changelog of Grav core, the following sound suspicious:

  1. When saving yaml and markdown, create also a cached version of the file and recompile it in opcache
  2. Fixed missing changes in yaml & markdown files if saved multiple times during the same second because of a caching issue

@k8n
Copy link

k8n commented May 19, 2022

@rhukster please help figure this out.

@mahagr mahagr self-assigned this May 20, 2022
@mahagr
Copy link
Member

mahagr commented May 20, 2022

I'm looking into this now. I am able to reproduce the issue, so I'm just trying to figure out what goes wrong.

@mahagr
Copy link
Member

mahagr commented May 20, 2022

Clearing cache fixed the issue for me. Huh..

@mahagr mahagr added the bug label May 20, 2022
@mahagr
Copy link
Member

mahagr commented May 20, 2022

Phew, that was a hard issue to track down. It's fixed now in CI!

@mahagr
Copy link
Member

mahagr commented May 20, 2022

(Was fixed in Grav)

@mahagr mahagr added the fixed label May 20, 2022
@pamtbaau
Copy link
Author

Great! Something I can do to test?

@mahagr
Copy link
Member

mahagr commented May 20, 2022

Looks like we didn't have CI builds available, lol. OK, so here's the fix:

getgrav/grav@6fa96ca#diff-c392650076318a0cca3f36706cc910159a2f35242ef8b7db4da2bcb61bad761dR141-R144

@pamtbaau
Copy link
Author

pamtbaau commented May 20, 2022

Cloned branch 'develop' and ran above steps. All seems to be working well!

Thank you!

@mahagr
Copy link
Member

mahagr commented May 20, 2022

Or that, lol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants