Skip to content

FileManagerInputWidget - fix/enhance item search from fileflyModule API #21

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

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

handcode
Copy link
Member

  • make currently hardcoded properties like minimumInputLength configurable via widget properties
  • make select2 data callback name dynamic, so we can configure the callback for each widget instance
  • enhance item formating to e.g. be able to display thumbnails
  • will require dmstr/yii2-filefly-module > 1.7.3

- make currently hardcoded properties like minimumInputLength configurable via widget properties
- make select2 data callback name dynamic, so we can configure the callback for each widget instance
- enhance item formating to e.g. be able to display thumbnails
- will require dmstr/yii2-filefly-module > 1.7.3
Copy link
Member

@schmunk42 schmunk42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -71,11 +121,11 @@ public function init()
'url' => $this->to('search', null),
'dataType' => 'json',
'delay' => 220,
'data' => new JsExpression('searchData'),
'data' => new JsExpression($this->jsGetSearchDataFuncName),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you should add an if(is_string) (or similar) around that because the JSExpression returns an empty string ('') for an empty value (null) and that could lead to problems.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a big fan of checks before using variables anywhere, but in this case a protected variable is used which is set in the int() of the widget (see line 108). So I don't see a scenario here where the variable could be set “incorrectly” or have i missed something?

@handcode handcode merged commit 3449dcc into master Feb 6, 2025
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

Successfully merging this pull request may close these issues.

3 participants