#1205: Several method existence checks don't deal with visibility
--------------------------------------+-------------------------------------
Reporter: michalchare...@… | Owner: david
Type: enhancement | Status: assigned
Priority: low | Milestone: 1.0.2
Component: _OTHER_ | Version: 1.0.1
Severity: minor | Keywords: view filter action model
context renderer
Has_patch: 0 |
--------------------------------------+-------------------------------------
Changes (by david):
* keywords: view filter => view filter action model context renderer
* status: new => assigned
* component: view => _OTHER_
Old description:
> I suspect line 739 of AgaviExecutionFilter.class.php should use
> "is_callable" rather than "method_exists" to check if a view implements
> an output type.
>
> This is so a base view class can implement "default" operations for an
> output type in a protected method. Then if a view wants to implement this
> output type, it can override this using a public method that just calls
> its protected parent function.
>
> (method_exists returns true for all functions, even protected ones that
> are not callable from the current scope, so cannot be used to distinguish
> between protected and public methods)
New description:
If the methods in question are non-public, then calls will fail, because
the function {{{method_exists()}}} that's used to see if a respective
method is there (e.g. on Actions and Views for request methods and output
types) doesn't take the visibility into account.
Affected are checks for:
* {{{AgaviAction::execute}}}''{{{Method}}}''{{{()}}} (in
{{{AgaviExecutionContainer}}})
* {{{AgaviAction::execute()}}} (in {{{AgaviExecutionContainer}}})
* {{{AgaviAction::validate}}}''{{{Method}}}''{{{()}}} (in
{{{AgaviExecutionContainer}}})
* {{{AgaviAction::registerValidators}}}''{{{Method}}}''{{{()}}} (in
{{{AgaviExecutionContainer}}})
* {{{AgaviView::execute}}}''{{{OutputType}}}''{{{()}}} (in
{{{AgaviExecutionContainer}}})
* {{{AgaviModel::initialize()}}} (in {{{AgaviContext}}})
* {{{AgaviContext::get}}}''{{{Item}}}''{{{()}}} (in {{{AgaviRenderer}}})
As well as testing constraints:
* {{{AgaviConstraintViewHandlesOutputType}}}
* {{{AgaviConstraintActionHandlesMethod}}}
--
Comment:
This is also the case in other places as well. Adjusting ticket
accordingly.
--
Ticket URL: <http://trac.agavi.org/ticket/1205#comment:1>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5
_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets