Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,458,298
Community Members
 
Community Events
176
Community Groups

Inserting an image from the clipboard filename does not get a timestamp

Edited

Since Confluence version 7.17, inserting images via the clipboard no longer works correctly. The image does not get a timestamp in the file name. This leads to the fact that a second inserted image gets the same file name (always grafik.png) and overwrites the first image. There is also no error message that the filename already exists.
Before version 7.17 images always got a filename in the form imageYYY-MM-DD_HH-MM-SS.png.
Possibly it is a problem of the translation. We use german

2 answers

1 accepted

0 votes
Answer accepted

We using Confulence Version 7.17.2 self hosted Server.

We use Firefox 100. The image name is always grafik.png.

Now i treid with the Chrome Browser Version 101.0.4951.64 and here I get a correct file name with timestamp e.g. image2022-5-12_10-50-39.png

There seems to be a problem with the new Firefox version.

 

We are using Confluence Version 7.17.4 and have the same problem.

If we use the same Firefox version and do the clipboard insertion (with CTRL-V) at a Jira comment or the description field then a file is generated with a unique filename.
This indicates for me that there is a problem with Confluence working together with the current Firefox version.

I have found the error. In newer Firefox versions, the filename has now been translated for Copy&Paste.

In older Firefox versions the name image.png was transmitted when inserting an image. In newer Firefox versions image.png was translated to grafik.png.

Therefore grafik.png does not match with image.png as specified in the javascript.

The javascript checks for image.png and then inserts the timestamp:

Here is the code:
if(e.name&&"image.png"!=e.name)o=e.name;else{var c=r?"-".concat(r):"";o="image".concat(i.getFullYear(),"-").concat(a,"-").concat(i.getDate(),"_"). concat(i.getHours(),"-").concat(i.getMinutes(),"-").concat(i.getSeconds()).concat(c,".png")}return{fileName:o,fileSize:t,slice:function(t,n){

Solution would be to insert in translation (global default languages) grafik.png for german and accordingly for other languages and then consider this translation with or expression in the javascript.

e.name&&("image.png"||"grafik.png")

 

 

 

Like Peter Ovenhausen likes this

We can also confirm the image-insert-from-clipboard-bug exists for Atlassian Confluence 7.18.1. Server Edition and also running a german instance.

The error is however not omnipresent.

It's present for one user, but not for another. Same setup (latest OS+Firefox 102.0.1), so it's weird.

Possible Workarounds:

1.) Save the images separetly and import them via makro

2.) Work with EDGE

The workaround are possible, but not elegant.

Is solely Firefox to blame??

It's because of the translation in Firefox. When pasting from the clipboard, the browsers provide a name for the image. Chrome, Edge etc. deliver image.png. In Firefox someone came up with the idea to translate this name in the German version from image.png to garfik.png. So the javascript in confluence / jira etc. can't match and therefore can't insert a timestamp. I assume that this translation is also done in other languages and is not only a problem of the German version.

Solution would be to insert in translation (global default languages) grafik.png for german and accordingly for other languages and then consider this translation with or expression in the javascript.

e.name&&("image.png"||"grafik.png")

Making this dependent on the localization of dozens of languages might not be a good idea as it can change unexpectedly in any language again. Additionally, we don't even know if the localization was intentional on the Mozilla side or a mistake.

Given this difficult situation, resolving this probably won't be easy or quick.

Above, Hardy identified a JS snippet responsible for building the names with timestamps. Does anyone know where this is coming from? If yes, we would have the option to patch it in our installation ourselves! As Hardy pointed out, the fix for the one language we use (mostly german from what i see) is not that hard.

Like Ulrich Hinze likes this

I'd be interested in where this java code is actually living, too! Any ideas how to find it?

There is an official Jira issue for this by now:

https://jira.atlassian.com/browse/CONFSERVER-79517

The problem is caused by a recent Firefox localization change.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.17.2
TAGS

Atlassian Community Events