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

[Bug]: *"View" action failed*, continues to view file #2066

Closed
4 of 8 tasks
ChristophWurst opened this issue Nov 15, 2023 · 6 comments · Fixed by nextcloud/server#41579
Closed
4 of 8 tasks

[Bug]: *"View" action failed*, continues to view file #2066

ChristophWurst opened this issue Nov 15, 2023 · 6 comments · Fixed by nextcloud/server#41579
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working
Milestone

Comments

@ChristophWurst
Copy link
Member

⚠️ This issue respects the following points: ⚠️

Bug description

1 2
Bildschirmfoto vom 2023-11-15 16-14-17 Bildschirmfoto vom 2023-11-15 16-14-20

Steps to reproduce

  1. Open a directory containing a BMP image
  2. Open the file's action menu
  3. Click View

Expected behavior

No error, or error and no image.

Installation method

None

Nextcloud Server version

28

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@ChristophWurst ChristophWurst added bug Something isn't working 1. to develop Accepted and waiting to be taken care of labels Nov 15, 2023
@ChristophWurst
Copy link
Member Author

It also happens with PDF and JPG.

@ChristophWurst ChristophWurst changed the title [Bug]: *"View" action failed*, continues to view image [Bug]: *"View" action failed*, continues to view file Nov 15, 2023
@ChristophWurst
Copy link
Member Author

viewer/src/views/Viewer.vue

Lines 922 to 937 in c5a7fb2

registerFileAction(new FileAction({
id: 'view',
displayName() {
return t('viewer', 'View')
},
iconSvgInline: () => EyeSvg,
default: DefaultType.DEFAULT,
enabled: (nodes) => {
// Faster to check if at least one node doesn't match the requirements
return !nodes.some(node => (
(node.permissions & Permission.READ) === 0
|| !this.Viewer.mimetypes.includes(node.mime)
))
},
exec: filesActionHandler,
}))
actions must be the one registered by Viewer.

The error "{displayName}" action failed is created by Files

@ChristophWurst
Copy link
Member Author

https://github.com/nextcloud/server/blob/ce6e3a3a01ee33fb010382cb33f527dcb8989544/apps/files/src/components/FileEntry/FileEntryActions.vue#L282-L293

the viewer action

returns undefined. Therefore it is assumed that the action ran into an error.

If it returns true there would be a success toast.
If it returns null the success and error toasts could be hidden.

@ChristophWurst ChristophWurst transferred this issue from nextcloud/server Nov 15, 2023
@ChristophWurst
Copy link
Member Author

cc @juliushaertl @max-nextcloud because this probably comes from the migration in #1878

@juliushaertl
Copy link
Member

Just from code reading I guess the return value of the action exec function of viewer is undefined not null.

exec: filesActionHandler,

// replace potential leading double slashes
const path = `${node.dirname}/${node.basename}`.replace(/^\/\//, '/')
const oldRoute = [
window.OCP.Files.Router.name,
window.OCP.Files.Router.params,
window.OCP.Files.Router.query,
true,
]
const onClose = () => window.OCP.Files.Router.goToRoute(...oldRoute)
pushToHistory(node, view, dir)
OCA.Viewer.open({ path, onPrev: pushToHistory, onNext: pushToHistory, onClose })

https://github.com/nextcloud/server/blob/c2c5994d7069464b9e69a54ce2c660a1a340c711/apps/files/src/components/FileEntry/FileEntryActions.vue#L285

@juliushaertl
Copy link
Member

juliushaertl commented Nov 17, 2023

I totally missed your earlier replies where you concluded the same 🙈

But good we are on the same page 🤝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants