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

Media Picker - upload button disabled bug #13383 #15115

Merged
merged 4 commits into from
Mar 5, 2024

Conversation

cheeseytoastie
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes (#13383)

Description

Issue is around how the folder path is "got" on the initialisation - if it doesn't come from localstorage (which is wiped on logout- hence how I could recreate). The function gotoFolder(folder) has entityResource.getAncestors that builds the folder path if it's not set (which it isn't on first init) but this isn't on a promise or awaited.

Modified the code that follows so it can only run once this returns by moving it to a separate function performGotoFolder(folder). It then has the path and on first open the editor can add images.

I've tested the following scenarios and it seems to work (without breaking everything).

Media picker with start node set.
Media picker without start node
User with limited media folders (e.g. can't see the start node). Seems to have resolved the issue.

To recreate (without fix). Create a media picker with a start node. Log out, load the media picker and you'll see the grey media picker where the editor cannot upload an image. But if the close and reopen it works.

After the fix this issue has gone. 🤞

Issue is around how the folder path is "got" on the initialisation - if it doesn't come from localstorage (which is wiped on logout- hence how I could recreate). The function gotoFolder(folder) has entityResource.getAncestors that builds the folder path if it's not set (which it isn't on first init) but this isn't on a promise or awaited.

Modified the code that follows so it can only run once this returns by moving it to a separate function performGotoFolder(folder). It then has the path and on first open the editor can add images.

I've tested the following scenarios and it seems to work (without breaking everything).

Media picker with start node set.
Media picker without start node
User with limited media folders (e.g. can't see the start node).
Seems to have resolved the issue.
Copy link

github-actions bot commented Nov 2, 2023

Hi there @cheeseytoastie, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@cheeseytoastie
Copy link
Contributor Author

Could we pretty please have this fix in v10. Would make a lot of my editors happy.

@lauraneto lauraneto linked an issue Nov 3, 2023 that may be closed by this pull request
@lauraneto
Copy link
Contributor

Hi @cheeseytoastie ,

Thank you for the pull request! 🙌
Someone from the Core Collaborators team will have a look at it soon.

Regarding v10, if the initial issue mentions v10 usually the fix is cherrypicked and included in the following v10 release! 🙂

@@ -264,18 +264,24 @@ angular.module("umbraco")
function (f) {
return f.path.indexOf($scope.startNodeId) !== -1;
});
folder.path = $scope.path[0].path;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor point, but is the tabbing slightly out on this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped this one. But hopefully the fix can still be merged in?

@nul800sebastiaan nul800sebastiaan merged commit 3b4ca0b into umbraco:contrib Mar 5, 2024
10 of 13 checks passed
@nul800sebastiaan
Copy link
Member

Thanks for this one @cheeseytoastie! Tests well and happy to relieve an annoyance 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Media Picker - upload button disabled
4 participants