Skip to content
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

[BUG]: PHP 8 db->delete throw exception if not pass empty array #15363

Closed
renatogabrielbr opened this issue Apr 2, 2021 · 8 comments · Fixed by #15479
Closed

[BUG]: PHP 8 db->delete throw exception if not pass empty array #15363

renatogabrielbr opened this issue Apr 2, 2021 · 8 comments · Fixed by #15479
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release breaks bc Functionality that breaks Backwards Compatibility bug A bug report status: high High

Comments

@renatogabrielbr
Copy link
Contributor

Works on update and insert.
Throw exception if not pass empty array as third argument.

PHP 8.0.3 
Version | 4.1.0
Build Date | Apr 1 2021 10:53:26
Powered by Zephir | Version 0.13.0-d89a471

$db = \Phalcon\Db\Adapter\Pdo\Postgresql

$this->db->delete('logs.test', 'updated_at < :date', [
            'date' => $this->dateHandler->newDateTimeInstance()
            ->substract()
        ]);

Throws

Phalcon\Db\Adapter\Pdo\AbstractPdo::execute(): Argument #3 ($bindTypes) must be of type array, null given

But if i pass as third argument an empty array works.

$this->db->delete('logs.test', 'updated_at < :date', [
            'date' => $this->dateHandler->newDateTimeInstance()
            ->substract()
        ],
[]); // EMPTY ARRAY
@renatogabrielbr renatogabrielbr added bug A bug report status: unverified Unverified labels Apr 2, 2021
@Jeckerson
Copy link
Member

You are using v4.1.0 which isn't compatible with PHP8.

@renatogabrielbr
Copy link
Contributor Author

Yes, but i did compile from v5.0.0-alpha.1

which is the correct php8 branch?

Thanks

@renatogabrielbr
Copy link
Contributor Author

renatogabrielbr commented Apr 2, 2021

Is this the only bug between php8 and phalcon 4.1.0? because i have tested all app and this is the only error

@Jeckerson
Copy link
Member

There are miss match in the interfaces, which gives you that exception.

@renatogabrielbr
Copy link
Contributor Author

oh ok, so which branch should i use to test on php8?

@Jeckerson
Copy link
Member

oh ok, so which branch should i use to test on php8?

v5.0.x

@renatogabrielbr
Copy link
Contributor Author

oh ok, so which branch should i use to test on php8?

v5.0.x

Hi, can you help me I`m on branch v 5.0.x , i did compile at least 4 times,

zephir fullclean
zephir compile
cd ext
phpize
./configure
make && make install

i also have use gen-build.php

Always give me the same phalcon 4.1.0 on phpinfo

i`m on ubuntu 20.1

@renatogabrielbr
Copy link
Contributor Author

Version | 5.0.0-alpha.1
Build Date | Apr 2 2021 12:38:32
Powered by Zephir | Version 0.13.0-99f0e65

Same error!

@Jeckerson Jeckerson reopened this May 4, 2021
@Jeckerson Jeckerson added 5.0 The issues we want to solve in the 5.0 release breaks bc Functionality that breaks Backwards Compatibility status: high High and removed status: unverified Unverified labels May 4, 2021
@Jeckerson Jeckerson self-assigned this May 10, 2021
Jeckerson added a commit that referenced this issue May 10, 2021
Jeckerson added a commit that referenced this issue May 10, 2021
@Jeckerson Jeckerson linked a pull request May 10, 2021 that will close this issue
5 tasks
Jeckerson added a commit that referenced this issue May 10, 2021
Jeckerson added a commit that referenced this issue May 10, 2021
Jeckerson added a commit that referenced this issue May 10, 2021
# Conflicts:
#	CHANGELOG-5.0.md
Jeckerson added a commit that referenced this issue May 10, 2021
#15363 - Fix db delete with passed `bindTypes`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release breaks bc Functionality that breaks Backwards Compatibility bug A bug report status: high High
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants