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

Source fields initializing incorrectly. #44

Open
patricknelson opened this issue Nov 13, 2019 · 1 comment
Open

Source fields initializing incorrectly. #44

patricknelson opened this issue Nov 13, 2019 · 1 comment

Comments

@patricknelson
Copy link
Contributor

patricknelson commented Nov 13, 2019

There are two three core issues:

  • The source fields parameter in constructor should default to empty array, not null.
  • The check on isset($this->sourceFields) in ->getSourceFields() will always return true thus preventing a default from ever being set.
  • Assuming ->getSourceFields() returned a default, the field name is for the current field, not the field you're searching. So, as it's currently written, it could easily result in a database query error.

Impact: The end result is that it's not possible to leave that field blank, even though the way it's written, it implies it is optional. Leaving this blank results in an error deep in the framework ultimately caused by the filter in this module defining a ->filterAny() entry with a key exactly equal to :PartialMatch (due to the $sourceField being null and coercing to an empty string).

Affects: Appears to affect 3.5.2 and 4.x (or dev-master).

@patricknelson
Copy link
Contributor Author

Updated above to reflect that there are three issues, not two (third issue being DB query error if you actually did default the source field on the source DataObject to the current field's name (likely on another DataObject).

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