FilterPane Plugin
  1. FilterPane Plugin
  2. GPFILTERPANE-81

associated property filtering not working with multiple associations to same domain class property

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Grails-FilterPane 2.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      given two domain classes

      class MyDomain {
          User createdBy
          User lastUpdatedBy
      }
      class User {
      }
      

      you cannot filter with associatedProperties="$

      {['lastUpdatedBy.id', 'createdBy.id']}

      " because the referenced class property is used as map key which is in this scenario 2x the same User.id GrailsDomainClassProperty. And here i am not speaking of values (they make no difference) but of equality of the GrailsDomainClassProperty instance.

      FilterPaneTagLib.groovy: refProperty = refDomain.identifier ... finalProps[refProperty] = dottedName

      this means only the last association based on the same property is used, former ones are overridden.

        Activity

        Hide
        Bob Finch added a comment - - edited

        I've attached a patch to FilterPaneTagLib.groovy based on FilterPane 2.0.1.1 that appears to fix this problem.

        Show
        Bob Finch added a comment - - edited I've attached a patch to FilterPaneTagLib.groovy based on FilterPane 2.0.1.1 that appears to fix this problem.

          People

          • Assignee:
            Steve Krenek
            Reporter:
            zyro
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: