List-Category-Posts icon indicating copy to clipboard operation
List-Category-Posts copied to clipboard

Allows using exclude ids for categorypage=yes

Open picandocodigo opened this issue 4 years ago • 5 comments

Would fix #355

picandocodigo avatar Jul 01 '20 22:07 picandocodigo

Code Climate has analyzed commit ce479e4c and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

codeclimate[bot] avatar Jul 01 '20 22:07 codeclimate[bot]

@zymeth25 I was giving this a shot, have some more uncommitted code, but I am exhausted and can't even read code anymore. I'll continue in the morning or maybe on the weekend, but yeah I'm refactoring the current_category function a bit more.

picandocodigo avatar Jul 01 '20 22:07 picandocodigo

@picandocodigo Sure, I will update the test suite so that once it passes we will know this is working.

klemens-st avatar Jul 02 '20 05:07 klemens-st

Thanks for the comments @zymeth25! I'll finish this PR during the weekend. I definitely need to rest some more after work and code less :grimacing:. I'll probably rewrite it. Once I wrote excluded_ids, I thought to just rewrite the entire current_category, but at some point I realized I wasn't thinking straight and nothing made sense. But I wanted to give you a heads up. I'll use your test from the other PR. I think I was thinking of excluding IDS for all the options for categorypage, but not sure if that makes sense? Anyway, I need to come back to this with fresh eyes. Thanks again!!

picandocodigo avatar Jul 02 '20 17:07 picandocodigo

Haha, sure, take your time and don't sacrifice your rest for this 😉

So I guess it doesn't make sense to do it for categorypage=other but could be done for yes and all. The simplest way that requires least changes is to:

  • return a string for [catlist categorypage=yes id=-1,-2] ('or' relationship), just comma delimited
  • return an array for [catlist categorypage=all id=-1,-2] ('and' relationship) like this
[3, 4, 'exclude' => [1, 2]]

Anyway, have a nice rest!

klemens-st avatar Jul 02 '20 18:07 klemens-st

Code Climate has analyzed commit 973c0ad7 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

codeclimate[bot] avatar Sep 05 '23 16:09 codeclimate[bot]