mirror of
https://github.com/wekan/wekan.git
synced 2025-12-23 10:50:13 +01:00
Merge pull request #4781 from mfilser/remove_duplicate_id_issue
Remove duplicate IDs issue
This commit is contained in:
commit
6b59c31e4f
2 changed files with 6 additions and 3 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { ObjectID } from 'bson';
|
||||||
|
|
||||||
const filesize = require('filesize');
|
const filesize = require('filesize');
|
||||||
const prettyMilliseconds = require('pretty-ms');
|
const prettyMilliseconds = require('pretty-ms');
|
||||||
|
|
||||||
|
|
@ -46,7 +48,7 @@ Template.cardAttachmentsPopup.events({
|
||||||
if (files) {
|
if (files) {
|
||||||
let uploads = [];
|
let uploads = [];
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const fileId = Random.id();
|
const fileId = new ObjectID().toString();
|
||||||
const config = {
|
const config = {
|
||||||
file: file,
|
file: file,
|
||||||
fileId: fileId,
|
fileId: fileId,
|
||||||
|
|
@ -130,7 +132,7 @@ Template.previewClipboardImagePopup.events({
|
||||||
if (pastedResults && pastedResults.file) {
|
if (pastedResults && pastedResults.file) {
|
||||||
const file = pastedResults.file;
|
const file = pastedResults.file;
|
||||||
window.oPasted = pastedResults;
|
window.oPasted = pastedResults;
|
||||||
const fileId = Random.id();
|
const fileId = new ObjectID().toString();
|
||||||
const config = {
|
const config = {
|
||||||
file,
|
file,
|
||||||
fileId: fileId,
|
fileId: fileId,
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { createObjectId } from './grid/createObjectId';
|
import { createObjectId } from './grid/createObjectId';
|
||||||
import { httpStreamOutput } from './httpStream.js'
|
import { httpStreamOutput } from './httpStream.js'
|
||||||
|
import { ObjectID } from 'bson';
|
||||||
|
|
||||||
export const STORAGE_NAME_FILESYSTEM = "fs";
|
export const STORAGE_NAME_FILESYSTEM = "fs";
|
||||||
export const STORAGE_NAME_GRIDFS = "gridfs";
|
export const STORAGE_NAME_GRIDFS = "gridfs";
|
||||||
|
|
@ -371,7 +372,7 @@ export const copyFile = function(fileObj, newCardId, fileStoreStrategyFactory) {
|
||||||
|
|
||||||
// https://forums.meteor.com/t/meteor-code-must-always-run-within-a-fiber-try-wrapping-callbacks-that-you-pass-to-non-meteor-libraries-with-meteor-bindenvironmen/40099/8
|
// https://forums.meteor.com/t/meteor-code-must-always-run-within-a-fiber-try-wrapping-callbacks-that-you-pass-to-non-meteor-libraries-with-meteor-bindenvironmen/40099/8
|
||||||
readStream.on('end', Meteor.bindEnvironment(() => {
|
readStream.on('end', Meteor.bindEnvironment(() => {
|
||||||
const fileId = Random.id();
|
const fileId = new ObjectID().toString();
|
||||||
Attachments.addFile(
|
Attachments.addFile(
|
||||||
tempPath,
|
tempPath,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue