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

Add filterType and filterOptions property for Column #630

Closed
wants to merge 1 commit into from

Conversation

ioleo
Copy link
Member

@ioleo ioleo commented Jul 27, 2013

Proposed change:

  • add filterType and filterOptions to Generator/Column.php
  • for filtersBuilder, if set, use filterType and filterOptions
  • not set -> fallback to current functionality
    • fieldguesser->getFilterType()
    • fieldguesser->getFilterOptions()

However.. this does not work. I'm still getting my formType and formOptions (on list filters) instead of filterType and filterOptions.

@cedriclombardot @sescandell @neoshadybeat any idea why this is not working / what am I missing?

@sescandell
Copy link
Member

@loostro

Take care that filters from list view are not generated with FiltersBuilder (this is the little thing that stopped me on #607 ).
Filters from list view are grabbed from form column configuration.

Maybe this is your problem?

@ioleo
Copy link
Member Author

ioleo commented Jul 28, 2013

@sescandell as far as I undestand, this is what (should) happen:

  • FilterBuilderType.php is used to generate FiltersType.php
  • FiltersBuilderType.php extends FiltersBuilder.php
  • FiltersBuilder.php extends BaseBuilder.php, but customizes the findColumns method
  • in this PR, I've modified the findColumns in FiltersBuilder.php to use filterType and filterOptions (they are set to Columns formType and formOptions)
  • in the template, under formType and formOptions should be values from filterType and filterOptions so the generated FiltersType.php should add the field with form type and options from filterType and filterOptions

Instead, the generated FiltersType.php always contains options from formType and formOptions.

So.. to figure out what is wrong, I've added in FiltersBuilder.php findColumns a simple logger (fopen [append mode] + fwrite + fclose). And in the file I got some really weird results:

The field I tested against was logged 3 times, 1 of them the type and options were from form, 2 of them were from filter. So it seems that FiltersType.php is generated in that first go. But why would this code be executed 3 times? And why diffrent results at each go?

@ioleo
Copy link
Member Author

ioleo commented Feb 24, 2014

Dropped

@ioleo ioleo closed this Feb 24, 2014
@sescandell sescandell deleted the feat-filter-type branch May 12, 2014 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants