Count field value in referenced entity is set globally. count per content type will be usefull , especially when user entity is referenced in different content type like project team, sports club etc.

Comments

ayesh’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.27 KB

try the attached patch. This will add a new setting to the field settings page to narrow down the count by bundles (node types, etc). Bundle will be checked with nr.bundle column if not empty.

giorgio79’s picture

Status: Needs review » Needs work
-sh-4.1$ git apply entityreference_count-restrict-count-to-specific-bundles-2035601-1.patch
entityreference_count-restrict-count-to-specific-bundles-2035601-1.patch:44: trailing whitespace.

error: patch failed: entityreference_count.module:16
error: entityreference_count.module: patch does not apply
giorgio79’s picture

Status: Needs work » Reviewed & tested by the community

Even though git gave a whitespace warning, the patch seems to be working fine :)

Exploratus’s picture

Patch is awesome. I wasn't able to use this module until this patch came along. Since I have different content types using the same reference fields, I couldn't count by node type. Now I can. This is a major improvement and should be committed. Great job!

damienmckenna’s picture

  • WorldFallz committed ee3b221 on 7.x-1.x authored by Ayesh
    Issue #2035601 by Ayesh, giorgio79: count per content type
    
WorldFallz’s picture

Status: Reviewed & tested by the community » Fixed

Had to adjust the patch for #2053273: Unknown column 'n.status' and also received the whitespace warning, but seems to be working fine. Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.