umbraco / Umbraco.Deploy.Issues

1 stars 0 forks source link

Extraction fails for dictionary item if language is deleted #176

Closed bjarnef closed 1 year ago

bjarnef commented 1 year ago

I noticed after deletion of default en-US language and committed to Umbraco Cloud, but if another developer on local environment still had en-US language and schema for dictionary items were generated with en-US translation for Umbraco Cloud, the extraction failed.

image

image

image

{
  "Date": "2023-08-21T12:54:50.756423+00:00",
  "Message": "The dictionary item 'General' cannot be deployed as the following languages are missing at the destination site: en-US.",
  "Ex": {
    "ClassName": "System.InvalidOperationException",
    "Message": "The dictionary item 'General' cannot be deployed as the following languages are missing at the destination site: en-US.",
    "Data": null,
    "InnerException": null,
    "HelpURL": null,
    "StackTraceString": "   at Umbraco.Deploy.Infrastructure.Connectors.ServiceConnectors.DictionaryItemConnector.Pass1(ArtifactDeployState`2 state, IDeployContext context)\r\n   at Umbraco.Deploy.Infrastructure.Connectors.ServiceConnectors.DictionaryItemConnector.Process(ArtifactDeployState`2 state, IDeployContext context, Int32 pass)\r\n   at Umbraco.Deploy.Infrastructure.Connectors.ServiceConnectors.ServiceConnectorBase`3.Process(ArtifactDeployState dart, IDeployContext context, Int32 pass)\r\n   at Umbraco.Deploy.Infrastructure.Environments.CurrentEnvironment.ProcessArtifacts(IEnumerable`1 arts, IDeployContext context, CancellationToken token)",
    "RemoteStackTraceString": null,
    "RemoteStackIndex": 0,
    "ExceptionMethod": null,
    "HResult": -2146233079,
    "Source": "Umbraco.Deploy.Infrastructure",
    "WatsonBuckets": null
  },
  "Sender": "Umbraco.Deploy.Infrastructure.Work.WorkItems.DiskReadWorkItem"
} 

Could it instead just skip the translation in case the language for some reason doesn't exist on the remote environment or maybe a warning instead of an error if possible?

Umbraco 12.1.0 Umbraco Deploy 12.0.1


_This item has been added to our backlog AB#32372_

bjarnef commented 1 year ago

If the other developer re-saved the dictionary items locally they were updated without en-US in translations and the extraction was successfully on live environment.

AndyButland commented 1 year ago

We've implemented a fix for this issue, so from the next releases there'll be a configuration option to allow you to ignore errors for dictionary items that contains translations for languages that don't exist in the target environment. They'll just be ignored when doing a transfer or a restore.

  "Deploy": {
    "Settings": {
      "IgnoreMissingLanguagesForDictionaryItems": true|false
    }
  }