Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pasting inline pictures from clipboard - collective show random pictures from other articles #1112

Closed
Ancii200 opened this issue Feb 12, 2024 · 9 comments · Fixed by nextcloud/text#5484
Assignees
Labels
3. to review bug Something isn't working

Comments

@Ancii200
Copy link

Describe the bug
It's about displaying newly created images saved in the clipboard and pasted into a page in the collective

To Reproduce
Steps to reproduce the behavior:

  1. Go to Collectives
  2. Create two new pages (page1 and page2) in collective
  3. take a screenshot and save it in the clipboard
  4. paste the first picture in page1
  5. do the same for the second page (take a new screenshot save it in the clipboard and paste it in page2)

Expected behavior
The images should be saved correctly and displayed accordingly

Actual behavior
Due to the same distribution of names, the images are not displayed correctly.
When editing it will still display normally, but from the moment you save it, it will show the other image at page 1.

Server details:

  • Collectives app version: 2.9.2
  • Nextcloud version: 27.1.5
  • PHP Version: 8.1
  • Database: MySql

Client details:

  • OS: Windows
  • Browser: Firefox, Chrome
  • Device: Desktop
@Ancii200 Ancii200 added the bug Something isn't working label Feb 12, 2024
@Githopp192
Copy link

Githopp192 commented Mar 7, 2024

Same to me ..

  • NC 27.1.7
  • app version: 2.9.2
  • PHP Version:8.2
  • Database: MariaDB

Client details:

OS: Windows Pro 11
Browser: MS Edge / newest version
Device: Desktop

I had created a lot of articles - unfortunately i noticed too late, that a lot of images (which were important Knowledge articles) now are lost.

Thinking to switch the whole content to JOPLIN.

@Aveyron-RetD
Copy link

You should put it in edit mode it is the only workaround i found

@mejo-
Copy link
Member

mejo- commented Mar 11, 2024

Dear all, thanks for the report. So far I failed to reproduce the issue. A clear and reliable reproducer would be helpful.

Some background information: when uploading an image or attachment to a collectives page, the file gets stored in a dedicated attachments folder. I don't see how images/attachments from different pages could get mixed here.

If you still have a page with the described problem, could you please check whether the correct images are in the attachments directory of the page? You can do this by following these steps:

  1. Find out the fileId of the page in question. You can find it in the URL of the page (the fileId=<id> query string parameter).
  2. Select 'Open in files' in the three-dot menu of the respective page (three-dot menu can be found in the top right corner)
  3. In the Files app, select 'Show hidden files' in the settings (settings can be found in the bottom left corner)
  4. Open the directory .attachments.<fileId> - which is the attachments directory for the page in question.
  5. See whether the expected images/attachments are in this directory, or whether the erroneously displayed ones are there.

@Aveyron-RetD
Copy link

Aveyron-RetD commented Mar 11, 2024

fileId=7821

=>all the images are there
image

=> In Edit mode => Correct images
image

=> In view mode => random => looks like they from another assets from fileID=8470
image

@mejo-
Copy link
Member

mejo- commented Mar 11, 2024

=> In view mode => random => looks like they from another assets from fileID=8470

Thanks a lot @Aveyron-RetD! Could you open the network tab in the developer tools of your browser, clear it and then reload the page (in view mode) and see whether there's requests to any other attachments folders than .attachments.8470?

@Aveyron-RetD
Copy link

What i did => Clear the cache and cookie.
=> reloaded the page in edit mode = OK
=> on the first view mode it looks like it was a different attachment i am sure it was the most recent pasted image i wanted to take a screenshot but did not
=> Click EDIT and finished and i am back with the same picture as above

@Aveyron-RetD
Copy link

Wonder if it's linked as well to comments section, nextcloud/activity#1772. Looks like they are linked to the wrong file.

@mejo- mejo- self-assigned this Mar 14, 2024
@mejo-
Copy link
Member

mejo- commented Mar 14, 2024

Thanks, I'm able to reproduce the issue now. If you change from one page to another and both include images with the same filename, then in view mode the image from former page is displayed. Clicking on the image or changing to edit mode displays the correct image.

mejo- added a commit to nextcloud/text that referenced this issue Mar 14, 2024
When switching pages in Collectives, `currentSession` might still be the
session from the last page. The readonly view (`MarkdownContentEditor`)
doesn't get a session, so the outdated session is used.

Instead, always pass the session from `AttachmentResolver` to
`setAttachmentList`.

Fixes: nextcloud/collectives#1112

Signed-off-by: Jonas <[email protected]>
@mejo-
Copy link
Member

mejo- commented Mar 14, 2024

This is a bug in Nextcloud Text. nextcloud/text#5484 fixes it. We'll take care that this lands in the upcoming Nextcloud 27 and 28 bugfix releases.

backportbot bot pushed a commit to nextcloud/text that referenced this issue Mar 14, 2024
When switching pages in Collectives, `currentSession` might still be the
session from the last page. The readonly view (`MarkdownContentEditor`)
doesn't get a session, so the outdated session is used.

Instead, always pass the session from `AttachmentResolver` to
`setAttachmentList`.

Fixes: nextcloud/collectives#1096
Fixes: nextcloud/collectives#1112

Signed-off-by: Jonas <[email protected]>
backportbot bot pushed a commit to nextcloud/text that referenced this issue Mar 14, 2024
When switching pages in Collectives, `currentSession` might still be the
session from the last page. The readonly view (`MarkdownContentEditor`)
doesn't get a session, so the outdated session is used.

Instead, always pass the session from `AttachmentResolver` to
`setAttachmentList`.

Fixes: nextcloud/collectives#1096
Fixes: nextcloud/collectives#1112

Signed-off-by: Jonas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants