wkallhof / Hazel

Fast, simple, markdown powered wiki knowledge base for Node.js
http://hazel.wmk.io
GNU General Public License v3.0
118 stars 28 forks source link

Image upload fail with non-existent `uploads_dir` directory #4

Closed gruentee closed 7 years ago

gruentee commented 8 years ago

Using the same setup as in #3. Node version: 6.1.0 NPM version: 3.8.6

When an non-existent uploads_dir key in config.json

In contrast to the content_dir and data_dir being created automatically uploads_dir is not. Maybe there should be a consistent default behaviour for all three of them?

Moreover when uploading without a uploads_dir the upload progress bar indicates a successful upload, although nothing is actually saved. When hovering over the upload file the pop-over shows "[Object Object]". That should be changed, too, IMHO.

wkallhof commented 7 years ago

@gruentee I just pushed up v1.1.4 which should fix the uploads directory issue. Let me know if you continue to see issues.

gruentee commented 7 years ago

I just tested it again (fresh install via npm) and get a slightly different error, screenshot and stack trace attached:

screenshot

TypeError: this._uploadImageHandler is not a function
    at StorageProvider.storeFile (/home/connzen/Projekte/node/hazel-test/node_modules/hazel-wiki/app/providers/storageProvider.js:164:21)
    at DocumentController.upload (/home/connzen/Projekte/node/hazel-test/node_modules/hazel-wiki/app/controllers/documentController.js:171:31)
    at Layer.handle [as handle_request] (/home/connzen/Projekte/node/hazel-test/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/connzen/Projekte/node/hazel-test/node_modules/express/lib/router/route.js:131:13)
    at AuthenticationProvider.authenticate (/home/connzen/Projekte/node/hazel-test/node_modules/hazel-wiki/app/providers/authenticationProvider.js:26:20)
    at Layer.handle [as handle_request] (/home/connzen/Projekte/node/hazel-test/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/connzen/Projekte/node/hazel-test/node_modules/express/lib/router/route.js:131:13)
    at Route.dispatch (/home/connzen/Projekte/node/hazel-test/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/connzen/Projekte/node/hazel-test/node_modules/express/lib/router/layer.js:95:5)
    at /home/connzen/Projekte/node/hazel-test/node_modules/express/lib/router/index.js:277:22
wkallhof commented 7 years ago

@gruentee Oops, just pushed up a fix. v1.1.5 should include the fix that properly initializes that variable. Let me know if it continues to cause problems.

gruentee commented 7 years ago

Thanks, works now. Maybe it should be mentioned somewhere in the docs (?) that the default behaviour is to create a uploads subdirectory under the hazel package directory.