Giter Club home page Giter Club logo

Comments (5)

distantnative avatar distantnative commented on May 26, 2024 1

@gbdesign2023 ehat he's saying is that the file itself was deleted but the files field still holds the reference to that non-existing file. He's right that the a panel won't show it, but tests like Empty/NotEmpty will say it has content.

from kirby.

distantnative avatar distantnative commented on May 26, 2024

I think the easy workaround would be

if ($file = $page->musicmp3()->toFile()) {
    $audioMusic[] = $fille->url();
}

from kirby.

trych avatar trych commented on May 26, 2024

Thanks for the super quick workaround, this solves my immediate problem. 🙏

However, I think the issue itself remains, the fields should not appear empty in the panel when they still hold content. 🙂

from kirby.

gbdesign2023 avatar gbdesign2023 commented on May 26, 2024

@trych Is it possible that no file template has been assigned to the file? Is the file still in the content folder? Please upload another file and check the .txt file to see if a template has been assigned.

from kirby.

rasteiner avatar rasteiner commented on May 26, 2024

I guess the question is whether a "File not found" symbol or graphic (like a crossed out filename or something) is really better than simply hiding the link to the non existing file.
I mean would it make the UX really better?
If I think of an example where a page has a pages field with min: 1, multiple: false, then something deletes the linked file from the server and therefore the user needs to relink a new file: would it really be better to have it show a non existing file first?

That also means the files field would need to store the name of the file (not only the uuid), otherwise, at most it could only display a random identifier which isn't really useful to a user. But storing the filename makes everything more complicated: when someone renames a file, kirby now has to update every reference to it in the whole website.

My 2 cts: I'm fine with having the reference missing in the panel as this reflects the results of a ->toFiles(), which is what the docs tell us to use

from kirby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.