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

Editing of File contents not possible when page name is "files" #5273

Closed
tobimori opened this issue Jun 12, 2023 · 7 comments · Fixed by #5308
Closed

Editing of File contents not possible when page name is "files" #5273

tobimori opened this issue Jun 12, 2023 · 7 comments · Fixed by #5308
Assignees
Milestone

Comments

@tobimori
Copy link
Contributor

tobimori commented Jun 12, 2023

Description

When the page name is files, and you're trying to edit a files' contents (e.g. an Alt text field) the lock panel request will fail and forbid any editing.

{
    "status": "error",
    "message": "Invalid model type: .",
    "code": 400,
    "exception": "Kirby\\Exception\\InvalidArgumentException",
    "key": "error.invalidArgument",
    "file": "../kirby/src/Cms/Find.php",
    "line": 126,
    "details": [],
    "route": "(.*)/lock"
}

Expected behavior
File contents editing world work normally as when the page name isn't files.

Screenshots
CleanShot 2023-06-13 at 00 07 52@2x

To reproduce

  1. Create a page with the slug files.
  2. Upload a file with custom blueprint that has fields.
  3. Open the file and try to edit a field

Your setup

Kirby Version 4.0.0-alpha.2 / 3.9.4

@distantnative
Copy link
Member

This is new with v4?

@tobimori tobimori changed the title [v4] Editing of File contents not possible when page name is "files" Editing of File contents not possible when page name is "files" Jun 13, 2023
@tobimori
Copy link
Contributor Author

This is new with v4?

You're right, it's also happening with 3.9.4, I just haven't noticed it yet because the lock calls where less frequent on another site.

@lukasbestle
Copy link
Member

Looks like the wrong API route matches.

@distantnative
Copy link
Member

@lukasbestle I think we only could solve this when moving to Panel urls based on UUIDs

@lukasbestle
Copy link
Member

lukasbestle commented Jun 14, 2023

Would be good to know which exact route causes this, so far it's only an assumption from me reading the issue. Because we separate page levels with + in API URLs, I feel like there should be a way to differentiate between "page called files" and "files of whatever page".

@bastianallgeier
Copy link
Member

@distantnative as soon as we move to UUIDs for panel URLs, we can no longer switch them off.

@distantnative
Copy link
Member

@bastianallgeier true

@lukasbestle so it's a call to the API such as http://sandbox.test/api/pages/files/files/team.jpg/lock, I would think all 5 lock API endpoints are affected as they all do pretty much the same with the path.

@distantnative distantnative self-assigned this Jun 18, 2023
@distantnative distantnative added this to the 3.9.6 milestone Jun 18, 2023
@distantnative distantnative linked a pull request Jun 18, 2023 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants