Comments (3)
@alan-null Are there other commands that do not properly handle the language?
from console.
@michaellwest I don't know. I haven't checked
from console.
It feels a bit like the PR is making assumptions, like:
- The rename happens right after the item is retrieved (As the value requires wrapping to happen to remember the language)
- Multiple consecutive renames may not be on the items with the same languages missing, e.g. if they are coming from a some table.
- The value is never wiped.
But based on the case here... we're modifying Name
which is version independent, which means we need ANY existing version to avoid the problem. Hence the solution provided just looks for the first existing version and does the operation on that.
Additionally found that the same problem may exist in Move-Item
and Transfer-Item
even though I didn't necessarily do much work to reproduce those.
Testing Script for Rename-Item:
$name1="Home2"
$name2="Home1"
$exoticLanguage = "pl-PL"
if(Test-Path "master:\content\$name1"){
$sourcePath = "master:\content\$name1"
$newName = $name2
$destinationPath = "master:\content\$name2"
} else {
$sourcePath = "master:\content\$name2"
$newName = $name1
$destinationPath = "master:\content\$name1"
if(!(Test-Path "master:\content\$name2")){
New-Item $sourcePath -Language $exoticLanguage -ItemType "Sample/Sample Item" | Out-Null
}
}
Remove-ItemVersion -Path $sourcePath -Language "en" -Version "*"
Get-Item $sourcePath -Language $exoticLanguage | Rename-Item -Newname $newName
Get-Item $destinationPath -Language * -Version *
from console.
Related Issues (20)
- Reports - Find Audit Trail from logs HOT 1
- Executing Receive-RemoteItem (Remoting) cause an error in Sitecore 10.3 HOT 1
- Package creation with -recurse childitems HOT 1
- Update-ItemReferrer Not working throwing unexpected error. HOT 2
- In Sitecore we could'nt able to unlock the item other than English version if we have global content manager role HOT 3
- It is not possible to search for scripts in the "Open" dropdown in ISE. HOT 1
- ISE Plugin "Scripts Containing" does not work most of the time HOT 1
- Script execution results should be less in-the-way
- NullReferenceException occurs when trying to accept VersionAddedNotification via PowerShell in Sitecore HOT 1
- The ability to open multiple scripts in tabs in a single ISE HOT 1
- Make "webedit:script" and "item:executescript" accept parameter aliases so it's less problematic to call them
- Add example of Experience Editor notification with an action button executing script HOT 1
- It should be possible to execute PowerShell Script Runner dialog and get script result back as dialog value
- Ribbon collapse button should work as intended HOT 1
- Sitecore 10.4 HOT 4
- Sitecore Powershell Script Elevated Unlock button is unlocking only English pages, for non-English Pages just showing running script but not unlocking items HOT 1
- Add ability to send deferred sheer messages and execute javascript to make it possible to e.g. refresh the content editor tree post script execution HOT 3
- DoubleClick on item in ListView does not run default action as intended but instead throws an error. HOT 3
- Supressing the "Running script" dialog, when calling script from the Content Editor HOT 2
- Build in a "Smart Copy"-function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from console.