We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code worked correctly through Phalcon 2.0.3
/** * DailySearchStats Model */ class DailySearchStats extends \Phalcon\Mvc\Model { ... /** * @return DailySearchStats */ public static function findFirst($parameters = []) { return parent::findFirst($parameters); } ... public static function increment() { $date = date('Y-m-d'); $stat = DailySearchStats::findFirst([ 'conditions' => 'curdate = :theDate:', 'bind'=>[ 'theDate' => $date ], 'for_update' => true ]); if (!$stat) { $stat = new DailySearchStats(); $stat->setCurdate($date); $stat->count = 1; } else { $stat->count++; } $stat->save(); } }
Then in the controller:
... public function searchAction(){ DailySearchStats::increment(); }
However, as of 2.0.4, I get the following error
PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
The line with the error is actually return parent::findFirst($parameters);.
return parent::findFirst($parameters);
If I remove "for_update" => true, the error disappears and everything works just fine.
"for_update" => true
I know there are plenty of other ways to perform the operation above but I'm just reporting the new bug from introduced upgrading from 2.0.3 to 2.0.4.
The text was updated successfully, but these errors were encountered:
Duplicate of #10621 and it's already fixed in the 2.0.x branch
Sorry, something went wrong.
Thanks for the update. I did a search before posting but looks like I barely missed it.
No branches or pull requests
The following code worked correctly through Phalcon 2.0.3
Then in the controller:
However, as of 2.0.4, I get the following error
PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
The line with the error is actually
return parent::findFirst($parameters);
.If I remove
"for_update" => true
, the error disappears and everything works just fine.I know there are plenty of other ways to perform the operation above but I'm just reporting the new bug from introduced upgrading from 2.0.3 to 2.0.4.
The text was updated successfully, but these errors were encountered: