-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
New template creates duplicate #9817
Comments
Hi @CodeartIT, I have not seen multiple templates being created with the same name, do you mean in the Templates tree in the backoffice? And does Umbraco add I just save that we have this weird behavior where a template is saved as soon as the name field loses focus, I can't remember why this is implemented in this way, but that could definitely have something to do with this problem. In any case, I think this behavior above should be changed and we should only save if you actually trigger the "Save" button. We'd love some help with that! I suspect that would also fix this problem you're experiencing. |
Hi @CodeartIT, We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know. For more information about issues and states, have a look at this blog post Thanks muchly, from your friendly Umbraco GitHub bot :-) |
I confirm for version 8.12.2. |
I would say it should never create templates om blur, but require an active save like everything else in backoffice UI. Not sure the reason behind thr save on blur was implemented as it previous only saved in button click or via shortcut key. |
It was implemented as part of f9761ad @nathanwoulfe do you recall why we need to bind the on blur event on name input field and save the template on blur? |
Maybe we should instead implement an optional |
The save on blur was added to avoid overwriting when a template file exists on disk but not in the backoffice. Without the blur event, the existing file would be overwritten with whatever the editor adds in the backoffice. Rather than a save on blur, should really just check for the existing file, and offer to load it. There may have been a requirement for saving, was a while ago so my memory isn't crystal clear. |
Alternatively we could debounce the save, I think the blur would still fire before the save click, so could suppress the button click if the blur has fired and not yet had a response |
@nathanwoulfe I still wonder if we should handle this another way than save in blur, since we don't do that elsewhere in backoffice UI. Maybe the save should instead check for existing template instead before creating a new. |
I don't remember if there was a reason we did the save this way, but it doesn't really make sense, especially since it's not done elsewhere... |
I think it comes down to Whether view exists or not on disk and when creating a new template from backoffice, the It could check here if the file exists on disk or maybe it should be handled in |
Actually it seems But the second parameter overwrite any existing file on disk, so it seems it works as expected. |
I have submitted a PR #10098 |
Hiya @CodeartIT, Just wanted to let you know that we noticed that this issue got a bit stale and might not be relevant any more. We will close this issue for now but we're happy to open it up again if you think it's still relevant (for example: it's a feature request that's not yet implemented, or it's a bug that's not yet been fixed). To open it this issue up again, you can write For example:
This will reopen the issue in the next few hours. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
When I want to create new template for masterpage and If I am using space in template name, for example "Master page", Umbraco will create 2 new templates with same name, sometimes umbraco creates 2 templates with same nameeven if I dont use space in name, but I am not sure why is that, because sometimes it works normal and sometimes not.
Update: My steps to reproduce sometimes dont work, so maybe space is not the reason. I am not shure what is the problem, but sometimes Umbraco deide to create duplicate template, I am not shure what is the reason.
Umbraco version
I am seeing this issue on Umbraco version: 8.11.1
Reproduction
Steps to reproduce
Expected result
Umbraco should create 1 new template with given name
Actual result
Umbraco creates 2 templates with same name
The text was updated successfully, but these errors were encountered: