question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

localFile .format property ignored by Admin UI

See original GitHub issue

Hi,

I’m having the same problem as this user: https://groups.google.com/forum/#!searchin/keystonejs/localFile$20format/keystonejs/KVKsu7eywek/851iYDO4pzsJ

The format property in the following example:

var Photo = new keystone.List('Photo',{track:true});

Photo.add({
    name: { type: Types.Key, required: true, index: true },
    photo: {
          type: Types.LocalFile,
          dest: './public/data',
          prefix: '/photo',
        allowedTypes: [
            'image/jpeg', 'image/png'
        ],
        format: function(item, file) {
            console.log('format()');
            return '<img src="/data/' + item.id + '.' + file.extension + '" style="max-width: 300px">';
        }
      }
});

… inserts no <img> tag at all in the detail page of an ‘image’ item in the Admin UI. Nor is the console message format() logged. I suspect this property is currenty broken. Currently running Keystone.js 0.3.10.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:20 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mochtucommented, Nov 8, 2015

Why is there no hint in the documentation that the 3.X branch does not support the format function on LocalFiles(s)? This is very confusing, @JedWatson !

0reactions
morenoh149commented, Jan 7, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

config.properties - Progress Documentation
MOVEit Automation Web Admin uses the information that is specified in the config.properties file to process configuration information. The config.properties ...
Read more >
File path formats on Windows systems | Microsoft Learn
In this article, learn about file path formats on Windows systems, such as traditional DOS paths, DOS device paths, and universal naming ...
Read more >
keystone | Yarn - Package Manager
Web Application Framework and Admin GUI / Content Management System built on ... KeystoneJS is a powerful Node.js content management system and web...
Read more >
Hive connector — Trino 403 Documentation
Enable reading data from subdirectories of table or partition locations. If disabled, subdirectories are ignored. This is equivalent to the hive.mapred.supports ...
Read more >
Apache NiFi Expression Language Guide
White space is ignored by the Expression Language between delimiters. Therefore, we can use the ... Variables defined in custom properties files through...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found