phpdevshell team mailing list archive
-
phpdevshell team
-
Mailing list archive
-
Message #00355
[Bug 689063] Re: Model override invoke cannot pass more than one parameter
In a normal invokeQuery() call, you specify the parameters one after the
other (not in an array) so I assumed it would the same for the override
invoke($param1, $param2, $etc) as well.
The problem is solved (no bug) when using invoke(array($param1, $param2,
$etc));
Thanks
--
You received this bug notification because you are a member of
PHPDevShell, which is subscribed to PHPDevShell.
https://bugs.launchpad.net/bugs/689063
Title:
Model override invoke cannot pass more than one parameter
Status in Open Source PHP RAD Framework with UI.:
Invalid
Bug description:
Using v3 beta4
In somePlugin, setup controller named test.php like this:
<?php
class test extends PHPDS_controller
{
public function execute()
{
$test = $this->db->invokeQuery('somePlugin_test', 'PHPDevShell_access_logging', '1');
echo '<pre>';
print_r($test);
echo '</pre>';
}
}
return 'test';
Now setup model named test.query.php like this
<?php
class somePlugin_test extends PHPDS_query
{
protected $sql = "
SELECT *
FROM _db_core_settings
WHERE setting_description='%s'
AND setting_value=%u
";
public function invoke($params)
{
list($x, $y) = $params;
$results = parent::invoke($x, $y);
return $results;
}
}
Now add menu button to link to test.php and click to see error:
vsprintf() [function.vsprintf]: Too few arguments
Error building sql for PHPDS_query
Now make the following change... change NOTHING ELSE except change the %u to 1 and it will perform without a problem.
References