Umbraco 8 - Weird behavior when copying items and using them within the same parent item - umbraco

So my problem is that when I copy items in Umbraco, that sometimes contain descendants and nested content, and then trying to use them inside the same parent item, it leads to a very weird behavior.
For example:
It renders the same nested content from the first copy.
Since I'm mapping those Umbraco items to dictionaries and lists in my
backend code, I get duplicate key error which breaks my app.
That issue is very detrimental to the work process of our content people since they can't use the Copy option.
Why is that happening, and how can I solve it?

Related

Xcode auto save file when navigating away

These are the cases when Xcode saves the files:
https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/UsingFileSaving.html
Is there a way to tell Xcode to save file each time when I navigate away? If the file is not saved, its content is not indexed, then it won't autocomplete. I always start typing, then I realize it's not indexed yet, then I press ⌘-B, then it saves and indexes, but adds error. Now I can type further, it autocompletes, but the error message appears with the previous starting letters, that it doesn't have any member, so it's a mess.
An autosave would be handy, or any other solutions for the problem above?

Why are "Multiple types were found that match the controller named 'ViewSwitcher'"?

I have an MVC 5 based solution, with a Client and Data project. It includes the partial _ViewSwitcher as I want to serve mobile and desktop browsers. On the home page, when I click the ViewSwitcher's Mobile view link, I get the following exception:
Multiple types were found that match the controller named 'ViewSwitcher'....
The request for 'ViewSwitcher' has found the following matching controllers:
PayCaddy.Data.Controllers.ViewSwitcherController
PayCaddy.Client.Controllers.ViewSwitcherController
I have done a solution wide search on all files for the term (not whole word) 'ViewSwitcher', and found only one .cs result, in the.Clientproject, and three results in_Layout.Mobile.cshtmland_ViewSwitcher.cshtml`. Plus I have manually checked the file system for any duplicate and found none.
What could be causing this?
It turns out that Client was referencing an old DLL of Data, not the Data project, i.e. it was an 'assembly reference' instead of a 'project reference'. Deleting the old DLL, and switching the reference to a project reference did the trick. But, not before I had to remove all using statements for Data, rebuild and get errors, and then replace all the usings. Now all is working fine.

Deleting document types, content now inaccessible

I am learning Umbraco (7) and deleted a test document type and template, without realising there was a content page using these (very surprised Umbraco lets you do this!)
I then couldn't access the content page to delete it (404 error). I created a new page, but that also had problems, almost certainly due to the database now having incorrect integrity, ie links now broken.
Two questions :
is there any way to prevent deletions where there are still linked content elements?
How would I fix this? Do I need to delete the orphaned content in the SQL backend db using SQL Management Studio? Or can something be done in the Umbraco front end eg scripts in macros?
Thanks
Unfortunately deleting a document type does in fact remove all content using that document type, I am unaware of any way to recover this content other than to restore a backup.
It is a fundamental flaw I think that you are able to do this so easily and has been there for as long as I have been working with Umbraco (since v3!).
Have you tried rebuilding your XML Cache file to try and overcome the orphaned link problems?
http://YOURDOMAIN/Umbraco/dialogs/republish.aspx?xml=true and
clicking "republish"
See this issue on the issue tracker:
U4-5187 Deleting doctype wipes out all content nodes based on it

How to detect the deleted data entry in Orchard cms Database?

I have created a module in Orchard cms, in which I created a form to collect the data and also added a image field(media). Now I have created a separate view(.chtml) to display the list of data that are collected from form in module in admin section.
Now suppose I added few data, let it be two entry in the form and I display all the two entry in newly created separate view. But When I delete the one of entry in form in admin section, it deleted and disappear there, but it is still present in database and visible in my newly created separate view. Can anyone please help me to know, how to detect the delete entry in Orchard Cms Database. I think it is soft deleted, because it is still in database but not showing in admin view section (dashboard).
Yes, Orchard always does soft deletes on content items. There are two boolean flags - Published and Latest - kept in table Orchard_Framework_ContentItemVersionRecord for each version. If both are false, the version is considered deleted. If there is no published and latest version for a given item, the whole item is considered deleted.
If a deleted item still appears in your custom view, you're probably doing some custom query in your code and you may need to revisit it. ContentManager fetches published versions by default (Get and Query methods) only.

umbraco richtext editor deleted

I had a problem with umbraco richtext editor, it was not letting me insert images, so I followed a forum and deleted the richtext editor datatype in the developer section, then i recreated the richtext editor datatype with the same settings.
My problem is: all the properties in the node which were of type RichText editor have disappeared from the content pages. i cant see the text and the editor. But i can still see the content on the website!
so i cannot edit them from the content section but i can see them on the website!
Kindly, help!
Most likely you need to add the bodyText property (or whatever you were using) to the document type(s) again. It's possible that the data was also removed, so beware republishing a node until you have the text back in there.
The reason you can still see the content on the site is because when a node is published, it's properties are cached. When the site has to access a property for the front end, it pulls it from the cache rather than getting it directly from the database. This allows the site to perform faster.
So add the rich text editor back to the document type. Copy the text from the front end back into the backend (hopefully you don't have a million pages), and always perform a backup of the site, database and all, before attempting fixes of this nature.
Have you tried access Developer/Data Types/Richtext editor and set again the options that you want?

Resources