Item6109: What happened to TWiki::User?
Current State: Closed
(originally reported on twiki.org, merged by KoenMartens)
Not clear to me how I should talk about this issue. Apologies if a bug report is the wrong way.
Running: TWiki-4.2.2, Wed, 06 Aug 2008, build 17396, Plugin API version 1.2
I just tried to install SignaturePlugin. It installs fine, but the plugin code fails. This happens because the plugin expects the user field of the session object to be a TWiki::User object. In fact, that field contains the user name.
Apparently TWiki was refactored to eliminate TWiki::User in 4.2. Hard to understand why such a major change in the API was made for a dot release.
This issue has already been noted in SignaturePluginDev. However, the original developer appears to be inactive. I could probably hack the plugin to accomodate the removal of User. But I'm not familiar with TWiki APIs, and bringing myself up to speed would require more time than I'll have to spare in the forseeable future.
Any hope of a backward compatability patch to support old plugins that need TWiki::User to exist? I suspect that there are a lot of valuable plugins that are broken because of its absence.
-- TWiki:Main/IsaacRabinovitch - 27 Oct 2008
Pointing back to TWiki:Plugins.SignaturePluginDev for further discussion and closing this bug.
-- OliverKrueger - 27 Oct 2008
I must respectfully disagree with your response to this issue. This is not about SignaturePlugin per se. As I said, several plugins seem to be affected. Anyway, I seem to have lost edit permission on SignaturePluginDev, so I have to respond here.
I call your attention to the TWiki::User API doc. It does not make it very clear that this object is part of the internal API and should not be used in plugins. The predictable result was that it was used in a lot of plugins that are now broken. This is a serious bug that needs to be addressed.
One option might be to bring back the object as a contrib. I'd volunteer to do that if it didn't involve too much work.
-- TWiki:Main.IsaacRabinovitch - 28 Oct 2008
Concerning the API: Func is the only official API since years now (afaik since Cairo). Most of the "voilations" to that fact are made by experienced contributors who should have known better.
-- TWiki:Main.OliverKrueger - 28 Oct 2008
Foswiki has documentation that makes it very clear what is "in" and what is "out" for plugins authors, which closes one aspect of this report.
While I understand Isaac's point about the implicit publishing of the User object, eliminating that object was a hard decision we had to take. Most extension authors have responded and fixed the few cases where the API was used. The appropriate resonse is not to republish an API that should never have been used (if we start doing that we are unable to ever refactor internal APIs). The appropriate (and much simpler) response is to re-code the SignaturePlugin. If the original developer is inactive and not responding to support requests, then we are going to have to find another developer prepared to support it.
Sorry, but I think we have to take a hard line on this. Perl is a completely open language, there is no way to block extension authors from using internal APIs.
Redirecting to SignaturePlugin and marking Urgent and for attention. I'll get to it eventually, if no-one else does. The fix is trivial.
-- CrawfordCurrie - 27 Nov 2008
OK, I fixed it.
-- CrawfordCurrie - 03 Dec 2008