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

Fix empty files considered non-existant (#15976) #15977

Merged
merged 1 commit into from Jan 19, 2022

Conversation

Mark-H
Copy link
Collaborator

@Mark-H Mark-H commented Jan 19, 2022

What does it do?

Fixes a logic issue in the media source implementation.

Why is it needed?

Relying on read() limits the functionality to files that can be read. But readable files may still exist and should be editable.

How to test

Create an empty file and try to edit it. Note MODX shows the "File doesn't exist!" error. Apply patch, try again.

Related issue(s)/PR(s)

#15976

@Mark-H Mark-H added this to the v3.0.0-rc2 milestone Jan 19, 2022
@Mark-H Mark-H requested a review from opengeek as a code owner January 19, 2022 17:16
@cla-bot cla-bot bot added the cla-signed CLA confirmed for contributors to this PR. label Jan 19, 2022
@opengeek opengeek modified the milestones: v3.0.0-rc2, v3.0.0-rc1 Jan 19, 2022
@opengeek opengeek linked an issue Jan 19, 2022 that may be closed by this pull request
@opengeek opengeek merged commit 76c39e8 into modxcms:3.x Jan 19, 2022
@Mark-H Mark-H deleted the fix-15976 branch January 19, 2022 17:25
@Ruslan-Aleev
Copy link
Collaborator

@Mark-H @opengeek the problem of opening a file from the element tree remains: an empty file is visible, but does not respond to clicks.

@Mark-H
Copy link
Collaborator Author

Mark-H commented Jan 21, 2022

It's working as expected here with the patch. Is the file readable?

@Ruslan-Aleev
Copy link
Collaborator

Readable, it seems. I can create a file, it opens when saving. But if I close it, I won't be able to open it again.
See gif (I click on the file):

emptyFile

p.s. I have Windows OS, can this be the case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed CLA confirmed for contributors to this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MODX does not allow you to create/open an empty file
3 participants