SAK-18616 has been marked as fixed. It isn't. I reported a problem that happens several places, and gave a patch for only one of them. That patch was installed and the ticket closed.
The problem is that the code for copying tools between sites doesn't work with tools that allow multiple instances. This occurs mostly in SiteAction, but in several places:
- creating a new site based on an old one
- site duplicate
- import tool into site, which has two variants, replace and merge
I'm probably forgetting one.
Each of these works differently and has different bugs. My big problem here is that there's an API issue. I'd prefer not to patch it myself. transfercopyentities has an argument "toolid". This is normally something like "sakai.lessonbuildertool". If there are multiple instances of a tool, they all have the same toolid. And in some cases you really need it to work this way. When creating a new site based on an old one, you want to copy all instances of the tool without having to list them. When doing an import replace you also want to do that. However the code for merging tools into an existing site produces a matrix showing each instance in each site, and letting you choose individual instances. The problem with this is that you get the title of the tool rather than of the instance, and that even if you fix everything, it doesn't work. And it can't, because the actual copy code can't copy instances, just tools.
I think the problem is that all of this code was written with no way to test it. I believe I maintain the only two tools that allow multiple instances and also support the copy operation. I'm reluctant to rip out lots of code from SiteAction, because I don't absolutely know that nothing is using it now. But I suspect that all code involving multiple instance tools has never been tried, and none of it will work.
For the moment I'm going to fix everything except import content with the merge operation, because that's the one that raises this issue. I'll add a diff for the other stuff later today.