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

Field with null values no longer work even set opion allowEmpty as true #63

Open
TABTyrell opened this issue Nov 28, 2024 · 0 comments
Open

Comments

@TABTyrell
Copy link

The option allowEmpty was introduced in #34

The plugin has been upgraded to support CakePHP v5. Despite the upgrade, the lines of code (LOC) remain unchanged

if (!$entity->has($config['field']) && Hash::get($config, 'allowEmpty') === true) {

In CakePHP v5, the Entity::has() changed as mentioned in here

This change caused an issue on my end where fields with null values triggered errors in buildRules. I prefer not to disable applicationRules to handle this scenario. Instead, it’s better to replace !Entity::has() with Entity::isEmpty() to address the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant