U4-9613 - ContentService.CountPublished ignores contentTypeAlias passed to method

Created by Simon Dingley 09 Mar 2017, 09:53:58 Updated by Simon Dingley 06 Nov 2017, 12:55:47

Tags: Unscheduled PR

Subtask of: U4-9609

I was trying to get a count of published documents by content type and kept getting the same result regardless of the doctype passed into the method. After checking the core I found that the method is defined as follows:

public int CountPublished(string contentTypeAlias = null) { var uow = UowProvider.GetUnitOfWork(); using (var repository = RepositoryFactory.CreateContentRepository(uow)) { return repository.CountPublished(); } }

...but would expect it to be more like

public int CountPublished(string contentTypeAlias = null) { var uow = UowProvider.GetUnitOfWork(); using (var repository = RepositoryFactory.CreateContentRepository(uow)) { return repository.CountPublished(contentTypeAlias); } }

Comments

Tim Payne 02 Nov 2017, 15:20:03

PR, done as part of UK Hackathon 2017

https://github.com/umbraco/Umbraco-CMS/pull/2291


Stephan 02 Nov 2017, 16:04:17

so weird, thanks for fixing! merged


Simon Dingley 06 Nov 2017, 12:55:47

Great stuff - thanks Tim! I don't know why I didn't submit the PR at the time I reported it, I must have been under pressure at the time and forgot to return to it. #h5yr


Priority: Minor

Type: Bug

State: Fixed

Assignee:

Difficulty: Easy

Category: Architecture

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.5.10

Due in version: 7.7.5

Sprint: Sprint 71

Story Points:

Cycle: