Item1333: Add getRequestObject
Priority: Urgent
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component:
Branches:
Since FSA took over from CGI, the old getCgiQuery method returns a request object. Provide a more meaningful API name.
Done (trunk only, old name still available for use by plugins etc)
--
CrawfordCurrie - 23 Apr 2009
We already now run into plugins that are not running on 1.0.X because of this change
Please revert it.
It is more important that plugins work than having the API names being 100% accurate Queens English
It makes no sense that plugins using getRequestObject are not compatible with 1.0.X ONLY because of a stupid name change.
See
Item1359 for the latest actual real life example of this going wrong. An extension has been ported to Foswiki but people downloading it will get "undefined subroutine" errors just because this API call changed name.
The API is a contract to extension developers and to our users. Please stop breaking that contract.
--
KennethLavrsen - 12 Oct 2009
No. "getCgiQuery" returns a
CGI
object. 'getRequestObject' returns a
Foswiki::Request
- which is a different type of object.
Sometimes the return value of getRequestObject is compatible with a CGI object (is a subclass of one) but also
sometimes it is not a CGI object at all, and does not support the same methods. It is far more than a name change, it is a fundamental change of underlying object type.
If the 'getRequestObject' function is available, it should be used. If it is not available, then the plugin may choose to fall back on 'getCgiQuery' with the caveat that a different kind of object is returned, and not all the functions of a request object will be supported.
--
CrawfordCurrie - 12 Oct 2009
You f**ing don't dismiss this without action when we have just seen how developers get trapped because this new API is not documented.
We just had
ExitPlugin released and people getting into trouble because of this.
As a minimum the documentation of the new Func call must be updated so it is clear that it should be avoided until 1.1 has been released for a while and the 1.0 is no longer relevant.
And once fixed this bug goes back in Waiting For Release so the API enhancement get in the release notes
--
KennethLavrsen - 12 Oct 2009
I do not agree with the language. But I would also like to see documented what is best practice how to check if a method exists.
--
ArthurClemens - 12 Oct 2009
Sorry, I was too hasty in rejecting it; it should of course remain open for the doc change. I'm rather busy at the moment, and
didn't think.
I'm not too keen on the language either. It tends to make me ignore communications, rather than pay them more attention.
Confirmed.
--
CrawfordCurrie - 13 Oct 2009
I would have taken Kenneths 'fosling' as honour.
--
FranzJosefGigler - 13 Oct 2009
After a review, I have some sympathy with the strength of Kenneth's reaction (though not the language). I reworked the doc accordingly.
--
CrawfordCurrie - 16 Nov 2009