-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
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
Validation::run() using Database\MySQL\Connection #6723
Comments
We use GitHub issues to track BUGS and to track approved DEVELOPMENT work packages. We use our forum to provide SUPPORT and to discuss FEATURE REQUESTS. |
Sadly, the suggested changes would cause the need to change the interface class (and we need really good reasons to do that), so personally, I don't think it's going to happen anytime soon. I'm curious about the use case you presented. Most likely, after getting the connection information from the database table, you're connecting to only one additional database simultaneously. I would consider creating a DB group like Another option would be to use a feature that already exists. Every connection (even dynamic) has a group name. With something like |
It seems if we fix this, it is a breaking change.
If it is true, maybe we would accept the change in @michalsn P.S. Oh, the interface bug was fixed in 4.3. |
Well... this is not a bug. Changing this would break other people's code if they extend the
Lol... I'm so good at checking things.
That's a relief. |
@michalsn Thank you for your opinion. However, bug fixes may still be needed to make the current interface realistically usable. |
What do you mean? Isn't this fixed in 4.3? |
ValidationInterface is fixed in 4.3. |
Sorry but, if I look how is DBgroup used in Validation, I can see thet it is used at is_unique, is_not_unique. If I follow the code I can see that DBGroup is used at Database:;connect that it allow to use string, array, instanceof BaseConnection... I think it is not good to limit on Validation->run() that the dbgroup must be ?string, because how it is used it can be a instaceof BaseConnection. is it not, true? |
@ciadavid Why don't you send a PR to v4.3.0 will be released soon. Once released, ValidationInterface cannot be changed until the next major version. |
Yes. But if we remove CodeIgniter4/system/Validation/Validation.php Line 109 in 558db23
|
Closed by #8499 |
PHP Version
7.3
CodeIgniter4 Version
4.2.7
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Windows, Linux
Which server did you use?
apache
Database
Mysql and MariaDB
What happened?
Whe I try to run() validation using directly a Database\MySQLi\Connection y get Error not text|null parameter.
I want to send
$validation->run($fieldsData,null,$this->db)
because I get connections from database configuration, I send directly the connection, insted $dbGroup.Validation works if I update the file vendor.....\system\Calidation\Validation.php line 109 (run() declaration), and remove ?string from $dbGroup = null, to allow other data, for example directly send Database|MySQLi\Connection.
Steps to Reproduce
configure 2 databases, directly, not use dbGroups.
Send validation run() and add a Database\MySQLi\Connnection insted $dbGroup.
If you delete
?string
fromvalidation::run()
declaration of$dbGroup
it works and not get error.Expected Output
allow to validetion::run() to send Database\MySQLi\Connection and $dbGroups.
Anything else?
No response
The text was updated successfully, but these errors were encountered: