keystonejs / keystone-classic

Node.js CMS and web app framework
http://v4.keystonejs.com
MIT License
14.64k stars 2.2k forks source link

Fix CloudinaryImages multi image upload functionality. #4957

Open 1337cookie opened 5 years ago

1337cookie commented 5 years ago

Description of changes

Change lodash flatten to flattenDeep. The lodash flatten function Flattens `array` a single level deep. which is inadequate for more than 2 image uploads as outlined in this comment. The lodash function flattenDeep Recursively flattens a nested array.

Related issues (if any)

Cloudinary: multiple images upload not working #4857

This may or may not be fixed in PR https://github.com/keystonejs/keystone/pull/4774 which is unlikely to be merged due to its size.

Testing

npm run test-all ran the same before and after changes we're made on Windows 10 and Ubuntu 18.04 (running in WSL). I don't foresee any browser issues associated with this. This error is thrown during tests which I have seen elsewhere and don't believe it is affected by this PR:

  1 failing
  1) FieldType: Markdown: Filter "before all" hook:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
ankeris commented 4 years ago

Can we still expect a minor/patch version release with this fix?