[BUG] Duplicate GetDelegatesFromContext in PostBackControl

in the file
Here's a patch to get rid of it
Here's the trace I followed: PostBackControl::Constructor() -> Control::Control() -> Delegation::Delegation() -> Delegation::GetDelegatesFromContext()
library/Framework/Framework.Class.Control.php
in the PostBackControl Constructor Method you will see that it is getting delegates from the context object. This duplicates the method already run way up in the Delegation class and doesn't seem to be needed.Here's a patch to get rid of it

Index: Framework.Class.Control.php
===================================================================
--- Framework.Class.Control.php (revision 184)
+++ Framework.Class.Control.php (working copy)
@@ -99,12 +99,7 @@
// from within it's own constructor
function Constructor(&$Context) {
$this->Control($Context);
- $this->Delegates = array();
$this->FormPostBackKey = ForceIncomingString('FormPostBackKey', '');
- // Get delegates from the context object that were added before this object was instantiated
- if (array_key_exists($this->Name, $this->Context->DelegateCollection)) {
- $this->Delegates = array_merge($this->Delegates, $this->Context->DelegateCollection[$this->Name]);
- }
// Define the postback action
$this->PostBackAction = ForceIncomingString('PostBackAction', '');
Here's the trace I followed: PostBackControl::Constructor() -> Control::Control() -> Delegation::Delegation() -> Delegation::GetDelegatesFromContext()
0
Comments