I do a lot of exporting and importing, and within the last month or so, I noticed an issue where the import process creates duplicate templates, styles, etc.
At first, I thought this was something I was doing wrong, but it’s happening when doing very straightforward imports with only minor changes to existing templates/styles, so I believe an issue has been introduced with a recent plugin update.
Before this issue appeared, the process was flawless, and I never once saw an issue after hundreds of exports and imports.
Basically, what happens is I will do an import and get an alert for a new file that already exists. The new template/style is renamed with a -2 at the end.
Yes, it’s how the importer recognizes duplicate templates across sites, since their post IDs can be different.
You’re right about the cause of the issue: from the screenshot, it looks like some templates are not getting assigned a universal ID for some reason, causing them to be created as duplicates during import. The logic for assigning universal IDs hasn’t changed in a while, so I’m not sure why/how the issue is happening - but the solution will be to make sure templates always have a universal ID assigned, during post save and maybe also check before exporting.
Right, I have many templates, some of which are quite old, so something probably happened in the past. I know how to ensure they all have the same UID now, so this should resolve the problem of migrating templates between websites.
It could be that the Permalink Manager Pro plugin is only querying for publicly viewable post types for listing in their settings page. L&L template types are registered as non-public, only for viewing in the admin area by admin users.
I think the issue will be solved when I implement #69, which is for the exporter to assign universal IDs to any templates that don’t have it yet.