umbraco / Umbraco.Deploy.Issues

1 stars 0 forks source link

Media Start Node missing when project is exported with UDA files /umbraco/backoffice/umbracoapi/mediatype/GetAllowedChildren #177

Closed juanlondonoforero closed 1 year ago

juanlondonoforero commented 1 year ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

11.4.2

Bug summary

I have a document type with an Image field that points to a starting node in the media folder. When the project is exported with UDA files the document type misses the starting node because the folder doesn't exist in the new environment, but even if the new media folder is created in the new environment the document type can't find it because it's using the media folder ID (not the name)

Specifics

No response

Steps to reproduce

Create document type with and Image field Set the starting node to a specific new folder in the media structure Move the project to a new environment The media folder structure doesn't exist so the doctType will generate an error. Creating the media folder wont resolve the issue because the DocType uses the folder ID not the name

Expected result / actual result

I expected to be able to select an image form the Content page, but instead I get /umbraco/backoffice/umbracoapi/mediatype/GetAllowedChildren No response

github-actions[bot] commented 1 year ago

Hi there @juanlondonoforero!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

andr317c commented 1 year ago

Hey! πŸ˜„

I've been looking at your issue, and I'm a bit unsure what you mean by the third step: 'Move the project to a new environment'. Can you provide more steps on how you perform the move?

And are you perhaps talking about a Cloud project? πŸ˜„

juanlondonoforero commented 1 year ago

yes andr317c if you copy the UDA files to a different Umbraco project on a different environment, all the document types are imported successfully but the media folder structure is not created so clearly the Image fields from the docTypes that point to a starting node won't be able to find the node because it doesn't exist I hope it makes more sense

andr317c commented 1 year ago

Hey

This sounds like a deploy issue, which is why I have transferred this issue to deploy πŸ˜„

juanlondonoforero commented 1 year ago

Thanks Anders To sum up: we uncommented the wwwroot as described in the screenshot 1; and we added the front end tasks in the pipeline that copies the CSS/JS folders to wwwroot (screenshot 2 step 3) The artifacts file is created correctly with all the css/js flders in the wwwroot but they are not displayed in the U-Cloud wwwroot folder

Thanks

Juan @.***

@.***

From: Andreas Zerbst @.> Sent: Tuesday, August 22, 2023 9:09 AM To: umbraco/Umbraco.Deploy.Issues @.> Cc: Juan Londono @.>; Author @.> Subject: Re: [umbraco/Umbraco.Deploy.Issues] Media Start Node missing when project is exported with UDA files /umbraco/backoffice/umbracoapi/mediatype/GetAllowedChildren (Issue #177)

CAUTION: This email originated from outside of the Bailie Group Corporate Network. Do not click links or open attachments unless you recognize the sender and know the content is safe.


HeyThis sounds like a deploy issue, which is why I have transferred this issue to deploy πŸ˜„β€”Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: <umbraco/Umbraco.Deploy.Issues/issues/177/1687689 β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ β€Œ

https://uk.report.cybergraph.mimecast.com/alert-details/?dep=iWnlqGM3LAvv0DkoRpnfGw%3D%3Du2Iu%2BEXizss49z52LiOLe5kWptlvUTWZjRbqFlmDjDuLxOKXOBzes%2FXh2HTGTAXALZ7ffJZJhcI6bj6ZMh8S8AS96HbBcMHRbCgncicKoxWkWpSTq%2BiUb3wxgR095XCQjCpPR%2Bigc3Glrd6Yrzc0L37ihGvVGbt9X5H%2Fmzr3tOcYj8E58Z9PXG4LluqXqOhQZ%2F8ilEIoMipxE6ImZ6FEf1pTnWKa2LCBKD0QFKSWUyv3Ya%2FsWdAR7ZXXqiF1h2gayGOR0rNXo6elXLgUBwAv9jNI95l1h3O7PDt6G21xC60MjCUWNoPhSnUNsGDauMVnWwRsHlQLHBys4p3cgBERz3HNDehNQ9%2B%2BlaAQVTv%2BWBN5wr1ma8s2a0qQpHwh3mmrvukwOsT50nmBF5g3Gg%2FjBEoEZQKc8B%2BsEBztUpejexFRY0Vz%2FNjiO1Z8%2BWp%2F8Cw%2BDb60j2TD6t2dNgSZ7KhEypSV2kgQpvJ3XlkbWuQeV1FGvj1WRpO7Uv228QAEAVzIdZ11R21wRTAqDCeTsPojlruw%2BCTvcdSl%2Ba7bv0vkjpe0j0icaePtCMCGJ7yRDGvvbnhkR%2FTFnzTafGIqJOJudea1h8mZfI6TX8LdNa%2BUpLdIru7jM7AOGFRYAuUE5Ldyp%2B8Mu05g0e9CFVwEd91OIa7jc0jVsGTyPUFGKegp4f%2BelU0X92wQs73BQlaTOQ%2BAVTvC34FC%2BFhIEcm5rv01dw1HRiMpC4zbx1YzEI1pMhcqumSSQeGCnbx7J0bs48EIJ%2BY0tlF4IEPO8%2FbenAeET7SaoOVlmuH6ly8GuaMCQbAODSW93b5IqyVUqlH%2BZtBHMVy6%2FO5tNDQX4zLp9Zp%2BfTtLKdmmiArxQL4gaGDpHJJUAtjvHDAi8X%2F79Fc3TaL90N4lyPNfTv60mqSLZkULRM4eq6l8%2F2mckg95y2uEgaF8L6DIyPGzHSqVc0TPqsRj

Hey

This sounds like a deploy issue, which is why I have transferred this issue to deploy πŸ˜„

β€” Reply to this email directly, view it on GitHubhttps://github.com/umbraco/Umbraco.Deploy.Issues/issues/177#issuecomment-1687689675, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALBSKTDIFBATPDY3CH2F3KDXWRSLLANCNFSM6AAAAAA3ZQFW6E. You are receiving this because you authored the thread.Message ID: @.**@.>>


This email message has been scanned for viruses by Mimecast. Mimecast delivers a complete managed email solution from a single web based platform. For more information please visit http://www.mimecast.com


CDS

Complete information and communication solutions

Visit our website www.cds.co.uk

Please do not print this email. Help conserve the environment.


This email transmission is intended for the named addressee only. Its contents are private and confidential and should not be used, read, copied or disclosed by any other person, nor forwarded to third parties without the senders consent. If you have received this email in error, please contact the sender immediately by return email or call +44 (0)113 399 4000, delete the email and destroy any copies made. Emails are not necessarily secure. Corporate Document Services Limited does not accept responsibility for changes made to this message after it was sent. If there is any doubt as to the authenticity of this email then a hardcopy should be requested. CDS may monitor and record emails and their contents passing through their network under the Telecommunications (Lawful Business Practices) and (Interception of Communications) Regulations 2000. All statements, views or opinions expressed in this email are those of the sender and shall be understood as neither given or endorsed by CDS. It is expressly declared that this email does not constitute or form part of a contract or unilateral obligation. CDS has scanned this email for viruses but does not accept any responsibility once this email has been transmitted. It is your responsibility as the recipient of this email to scan attachments (if any) for viruses. CDS excludes all liability to you or any third party in respect of the contents of this email (to the maximum extent permitted by the law).

Registered office: Corporate Document Services Ltd (CDS), Riverside House, 7 Canal Wharf, Leeds, LS11 5AS, United Kingdom. Co. reg. no. 2925653 VAT no.393 5490 21.

AndyButland commented 1 year ago

Unfortunately I don't think there's a perfect solution to this scenario. This issue is that, as you've found, the definition of the data type contains a reference to the start folder using it's GUID based identifier. When an item in Umbraco is created via the backoffice, it's assigned a GUID, and as such even if you create an item with the same name in two environments, it'll have a different GUID set.

Most Umbraco data is clearly separable into that managed by developers (document types, data types) and that by editors (content, media), but sometimes, as in this case, there's an overlap where a "schema" item depends on something managed as "content".

I feel that all you can do here is to ensure that your media folders have consistent GUIDs between environments. If setting up from scratch, you could create the data type and media folder in a development environment. The .uda file for the data type will have a reference to the folder by GUID. And if you use the content transfer facilities to deploy your media folders into the upstream environment, rather than recreating them there directly, they'll have the same GUID and be identified.

Another approach would be to write some code in a composer that runs on start up, that creates the folders you need, with the appropriate GUIDs, if they don't already exist.

If you already have environments setup, you could remove the start folder from the data type, deploy the schema, transfer the media folders and then re-add the start folder to the data type again.

Finally, you can amend the GUIDs via a database query such that they match between environments. Please make sure to test and backup before running, particularly in production, but something like this can be used to update the GUIDs in the database:

DECLARE @id as uniqueidentifier

USE devdb

SET @id = (
    SELECT uniqueid
    FROM umbracoNode
    WHERE nodeObjectType = 'B796F64C-1F99-4FFB-B886-4BF4BC011A9C' and text = 'My Folder Name')

USE proddb

UPDATE umbracoNode
SET uniqueid = @id
WHERE nodeObjectType = 'B796F64C-1F99-4FFB-B886-4BF4BC011A9C' and text = 'My Folder Name'