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

Question - What takes priority #64

Closed
NikRimington opened this issue Nov 4, 2019 · 4 comments
Closed

Question - What takes priority #64

NikRimington opened this issue Nov 4, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@NikRimington
Copy link
Contributor

Firstly, I've not tried reproducing this on a different environment and this is more of a query/question than it is a bug/issue at this stage.

I've got a site that is using Nested Content to build up programmes for an event. On a doctype called Programme Slot there is a start time and end time field. At one point in time these fields were DateTime inputs, but more recently were replaced with a custom Time field. They were replaced by changing the underlying data type from a date time to a time type. But everything else about the "Data Type" stayed the same.

However, deploying this change via uSync didn't deploy correctly. It updates the data type and then appears to undo the change.

Looking into the usync files:

DataType definition file has the correct data type "type" alias stored against it.

Document Type, in the properties listing it has the old data type "type" alias against it.

So, am I right in thinking the DataType file is updated, and then when the doctype is imported/verified it is conflicting and converting it back?

If so, shouldn't the DataType file details take priority over the "data type" definition that is within the document type?

Example extracts:

DataType File:

<?xml version="1.0" encoding="utf-8"?>
<DataType Key="6781db3c-36b8-491d-9929-0d0f1edf6db2" Alias="Time Picker" Level="2">
  <Info>
    <Name>Time Picker</Name>
    <EditorAlias>SD.TimePicker</EditorAlias>
    <DatabaseType>Date</DatabaseType>
    <Folder>Custom</Folder>
  </Info>
  <Config><![CDATA[{}]]></Config>
</DataType>

Content Type File extract:

<GenericProperty>
      <Key>10f66742-6885-4440-8e9d-27d0733becef</Key>
      <Name>End Time</Name>
      <Alias>endTime</Alias>
      <Definition>6781db3c-36b8-491d-9929-0d0f1edf6db2</Definition>
      <Type>Umbraco.DateTime</Type>
      <Mandatory>false</Mandatory>
      <Validation></Validation>
      <Description><![CDATA[What time does this slot end?]]></Description>
      <SortOrder>6</SortOrder>
      <Tab>Content</Tab>
      <Variations>Nothing</Variations>
</GenericProperty>
@KevinJump
Copy link
Owner

Hi,

I will have to take a look, but if it is reverting back its more likely a Umbraco thing than a uSync one :(

there has long been issues converting datatypes, in v7, for example, I don't think the methods to do that was pubic, so it was a bit hit and miss.

but in uSync, we only change the underlying type in the datatype, it might be that the save of hte doctype with the wrong datatype might be enough for umbraco to flick it back.

I think it might be a case of re-exporting all effected Content Types when a Datatype changes its storage type, but i will have to take a look at if that is something we can do reliably, or just something we will document as a recommended step 😕

@NikRimington
Copy link
Contributor Author

If the info is in the config files. Is it something that could be reported on if there is a conflict? Just a thought, because then at least it's know and can be corrected and re-deployed? :-)

KevinJump pushed a commit that referenced this issue Nov 4, 2019
Not setting the editor alias unless we have to, and making sure it matches the datatype we actually found.
@KevinJump
Copy link
Owner

looking at the code the Type is only meant to be used as a fallback (if we can't find the datatype by GUID) but we were then setting it - incase that value was blank so i suspect that is what is doing it !

need to test these updates, but I think they will resolve it without us needed to do mass file updates (although I might still, and a message on the report telling you the files are off is certainly worth looking into)

@KevinJump KevinJump added the bug Something isn't working label Nov 5, 2019
@KevinJump KevinJump self-assigned this Nov 5, 2019
@KevinJump
Copy link
Owner

this fix is in the latest release 8.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants