OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Update Import/Export module to use separate XML elements for features #8000

Open dukeofdarkness23 opened 6 years ago

dukeofdarkness23 commented 6 years ago

By default, when using the Import/Export module and creating an export, and choosing to include Enabled and/or Disabled Features - the generated xml includes a single xml element with a concatenated string of all of the features as an xml attribute:

<Feature enable="... Orchard.Alias, Orchard.Autoroute, Orchard.Conditions, Orchard.ContentPicker, Orchard.ImportExport, Orchard.Modules, Orchard.MultiTenancy, Orchard.Packaging, Orchard.Pages, Orchard.Recipes, Orchard.Resources, Orchard.Roles... " />

This is difficult to read when manually checking a file, especially when there are a large number of features included and defeats the point of having an xml file with individual elements and attributes for relevant data items.

I propose that the Orchard.Modules module be updated so that the import/export steps add each feature as an individual xml element nested under the relevant enabled/disabled tag:

<Feature>
 <Enable>
  ...
  <Id>Orchard.Lists</Id>
  <Id>Orchard.MediaLibrary</Id>
  <Id>Orchard.MediaProcessing</Id>
  <Id>Orchard.Modules</Id>
  <Id>Orchard.OutputCache</Id>
  <Id>Orchard.Packaging</Id>
  ...
</Enable>
</Feature>

I have some sample code available on our Orchard fork on GitHub, branch "BI/issue/185-A" here which we use in our sites.

sebastienros commented 6 years ago

Ok, as long as it also looks for the current attribute when executing the recipe.

dukeofdarkness23 commented 6 years ago

Added code to ensure legacy attribute processing is actioned before processing xml elements.