Fix wrong count of associations
Fix wrong count of associations

Counting entry_ids does not work since it is possible that passed id are
not part of the current relation ship.

Using the same logic variable and usign the count from the DB is way
less error prone.

Re #2698
Re #2720
Fixes #2713

bauhouse/sym-todo-list,jensscherbl/symphony,bauhouse/sym-todo-list,symphonycms/symphony-2,jensscherbl/symphony,michael-e/symphony-2,michael-e/symphony-2,symphonycms/symphony-2