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

Listview batch publishing on multi language site, publishes all variants #13755 - Fix #13772

Merged
merged 3 commits into from Feb 26, 2023

Conversation

mennomout
Copy link
Contributor

@mennomout mennomout commented Feb 1, 2023

Prerequisites

Fixes: #13755

Description

Modified PostPublishById to handle content that is culture variant. Added a new model for the endpoint and modified the JavaScript function that calls said endpoint.

I've tested these changes by creating a new doctype with list view enabled. I've allowed another doctype as it's child. Both doctypes are culture variant. After these changes you can publish one culture from the list view and the other culture will remain unpublished. I'd like someone else to test these changes as well. There were a few occasions where it looked like it wasn't working but I wasn't really able to replicate that.

See gif below for the result:
listviewsave

…dded model and modified the javascript function that call the api endpoint.
@github-actions
Copy link

github-actions bot commented Feb 1, 2023

Hi there @mennomout, 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 🤖 🙂

@mikecp
Copy link
Contributor

mikecp commented Feb 6, 2023

Hi @mennomout ,
Thanks a lot for this PR, it's gonna fix an annoying problem 👍

I had a quick look at it and I would suggest to create a separate controller method for this scenario, and then to handle in the Javascript part which one will be called, depending on whether or not you have cultures specified: no culture => call as now, specific culture => new method.
The main reason is that I think that changing the signature of the controller will be seen as a breaking change, which we cannot merge in minor versions, and also this will allow you to get rid of that big if/else block 😁
So, in other words, doing the if/else at the Javascript side might make things a little less complex.

I was also wondering how the "cultures" param was sent through to the Javascript method since you don't seem to be modifying the caller(s) to that function, but this is probably because I did not actually run you solution locally yet 😅

I'll make sure to check in details later, but I thought it was already worth mentioning those two points.

Cheers!

@mennomout

This comment was marked as resolved.

@mennomout

This comment was marked as resolved.

@mennomout
Copy link
Contributor Author

@mikecp I've made some changes based on your suggestions. Please let me know if there is anything else I can do to improve the PR.

@mikecp
Copy link
Contributor

mikecp commented Feb 21, 2023

Hi @mennomout ,

Thanks for the update, it looks less complex in this new version, and it is also non breaking 😉 👍

It all works fine but I left a few suggestions that might improve performances a bit, let me know if they seem OK to you.

Cheers!

…hByIdAndCulture. Added parameter to ngDoc. Added Where Query.
@mennomout
Copy link
Contributor Author

@mikecp I've implemented your suggested changes. Thank you again for the feedback!

@mikecp
Copy link
Contributor

mikecp commented Feb 26, 2023

Thanks a lot @mennomout for the adaptations!
This is a great fix that solves a bug I'm sure quite a lot of people were impacted by 👍

And congratulations on your first contribution to the Umbraco CMS 🎉
If you provide us with your account name on Our, @nul800sebastiaan will be very happy to assign our shiny contributor's badge to you 🥇

And now we'll be looking forward to your next PR"s 😁

Cheers!

@mikecp mikecp merged commit 37db3ae into umbraco:contrib Feb 26, 2023
@mennomout
Copy link
Contributor Author

@mikecp Thank you for the kind words and assistance with this PR!

@nul800sebastiaan My OurUmbraco profile is: https://our.umbraco.com/members/mennomout/

@nul800sebastiaan
Copy link
Member

Badge added @mennomout - thanks again and congrats! 🏅

@mennomout mennomout deleted the temp-13755 branch March 1, 2023 10:46
@cornehoskam
Copy link
Contributor

Wonderful job @mennomout! Glad to see your first contribution merged into the source-code!

@mennomout
Copy link
Contributor Author

Thank you both @nul800sebastiaan and @cornehoskam!

nul800sebastiaan pushed a commit that referenced this pull request Mar 16, 2023
…nts #13755 - Fix (#13772)

* Modified PostPublishById to handle content that is culture variant. Added model and modified the javascript function that call the api endpoint.

* Added separate method for publishing with cultures. Added if else statment to js function.

* Moved check for all cultures being published to the top of PostPublishByIdAndCulture. Added parameter to ngDoc. Added Where Query.

(cherry picked from commit 37db3ae)
@nul800sebastiaan
Copy link
Member

Cherry picked for 10.5 in 273e770

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.

Listview batch publishing on multi language site, publishes all variants
4 participants