Ticket #4115 (closed defect (bug): fixed)

Opened 2 years ago

Last modified 1 year ago

getCategoryList should not include Blogroll in list of categories

Reported by: redsweater Assigned to: anonymous
Priority: normal Milestone: 2.3
Component: XML-RPC Version: 2.2
Severity: normal Keywords: needs-patch
Cc: redsweater, josephscott

Description

The list of categories returned by getCategoryList should exclude "empty" categories by default, as this is how the web UI behaves. It's awkward for desktop clients to have a list with weird category names such as "Blogroll" that are only used in Links.

This is accomplished in xmlrpc.php by adding a " WHERE category_count > 0" clause to the (questionable) direct SQL lookup.

Patch attached: xmlrpc.php.diff

Attachments

xmlrpc.php.diff (0.7 kB) - added by redsweater on 04/08/07 20:56:49.
Patch to exclude empty categories from the getCategoryList function call.

Change History

04/08/07 20:56:49 changed by redsweater

  • attachment xmlrpc.php.diff added.

Patch to exclude empty categories from the getCategoryList function call.

04/08/07 21:18:26 changed by redsweater

Thinking about this a bit more, it might be a mistake to change the existing functionality to exclude categories that were previously included. I suppose some clients might rely on this behavior.

I wonder if it would be reasonable to instead add some custom fields to the struct, to advertise the "has children" attribute.

Daniel

(in reply to: ↑ description ; follow-up: ↓ 3 ) 04/09/07 02:14:55 changed by rob1n

Replying to redsweater:

The list of categories returned by getCategoryList should exclude "empty" categories by default, as this is how the web UI behaves. It's awkward for desktop clients to have a list with weird category names such as "Blogroll" that are only used in Links.

I don't agree. Technically, even though they are empty, empty categories are still categories and thus should be included when getCategoryList is called.

Making the XMLRPC work exactly like web UI doesn't exactly make sense, as they're two different implementations.

(in reply to: ↑ 2 ) 04/09/07 15:19:11 changed by foolswisdom

  • milestone changed from 2.4 to 2.2.

Replying to rob1n:

I don't agree. Technically, even though they are empty, empty categories are still categories and thus should be included when getCategoryList is called. Making the XMLRPC work exactly like web UI doesn't exactly make sense, as they're two different implementations.

I think redsweater describes the best experience for the customer. What is your concern with that experience rob1n?

04/09/07 15:19:26 changed by foolswisdom

  • keywords set to has-patch.

(follow-up: ↓ 6 ) 04/09/07 16:31:48 changed by Otto42

I agree with rob1n. getCategoryList should return a list of all viable categories for posting into, empty or not. It may make sense to exclude link categories, but empty categories must be returned.

Specific example: I'm using an XML-RPC posting client on, say, my cell phone. It pulls the categories and lets me type a post in. It can't create a category, and it can't assign multiple categories, because it's a crap client. But still, it's got a list of cats and I can pick one.

So I make a new category in WP, called "Phone Posts". I go to my phone, pull up the client.. Only the category is not in my list. And it's not going to be until I make a post to that category using something other than the XML-RPC client, because we exclude empty categories? That makes little sense.

(in reply to: ↑ 5 ; follow-up: ↓ 7 ) 04/09/07 16:39:24 changed by foolswisdom

  • keywords changed from has-patch to needs-patch.

Replying to Otto42:

I agree with rob1n. getCategoryList should return a list of all viable categories for posting into, empty or not. It may make sense to exclude link categories, but empty categories must be returned.

Filtering out link categories that have only been used for link categories seems like a decent compromise with a goog UX.

(in reply to: ↑ 6 ) 04/10/07 18:20:42 changed by redsweater

  • cc set to redsweater.

Replying to foolswisdom:

Replying to Otto42:

I agree with rob1n. getCategoryList should return a list of all viable categories for posting into, empty or not. It may make sense to exclude link categories, but empty categories must be returned.

Filtering out link categories that have only been used for link categories seems like a decent compromise with a goog UX.

I like this compromise too, for what it's worth :)

In fact, I think giving users the ability to select empty, non-link categories is perhaps a preferrable user experience to the "hide empties" behavior in the web interface.

(follow-up: ↓ 9 ) 04/12/07 16:21:33 changed by rob1n

  • milestone changed from 2.2 to 2.3.

I don't think hiding link categories is correct, since unless I'm missing something big, posts can go into link categories. The categories are essentially transient -- they're post categories, link categories, and tags. Don't ask about the last one... I along with many others wanted tags in another table.

(in reply to: ↑ 8 ; follow-up: ↓ 10 ) 04/12/07 16:41:07 changed by foolswisdom

Replying to rob1n:

I don't think hiding link categories is correct, since unless I'm missing something big, posts can > go into link categories.

A link category is defined to me as one that has been used for links, but has not yet been used for posts. That seems like a good compromise. Do you have a suggestion for a better experience?

(in reply to: ↑ 9 ) 05/01/07 12:47:23 changed by rob1n

Replying to foolswisdom:

Replying to rob1n:

I don't think hiding link categories is correct, since unless I'm missing something big, posts can > go into link categories.

A link category is defined to me as one that has been used for links, but has not yet been used for posts. That seems like a good compromise. Do you have a suggestion for a better experience?

Yes, but in the current category setup, link categories and post categories are transparent. So technically they're only "categories," from a semantic point of view. If we didn't show these in getCategoryList, then it wouldn't *really* be getCategoryList, would it? ;)

But it also detracts from being able to post into all categories that you *can*, since the XML-RPC client wouldn't be aware of the other categories unless we extend and make a new API, but that wouldn't be supported at all.

09/05/07 17:00:27 changed by josephscott

  • cc changed from redsweater to redsweater, josephscott.

09/05/07 17:14:01 changed by Otto42

Is this even relevant anymore? With the new terms stuff, categories got separated again. We now are (sadly) back to having more or less completely separated post and link categories. Same table, but with a separation on column content nevertheless.

Somebody should check to make sure XMLRPC works as expected for getCategoryList and if so, mark this one as invalid.

11/01/07 17:11:19 changed by redsweater

  • summary changed from getCategoryList should exclude empty categories by default to getCategoryList should not include Blogroll in list of categories.

I'm changing the Summary from:

getCategoryList should exclude empty categories by default

to:

getCategoryList should not include Blogroll in list of categories

That better emphasizes my core concern here. I thought when I first reported this that it might get better traction if I stated the problem as more of a "consistency problem." But what I really want is to get that dang "Blogroll" item out of the category list, because it confuses my users (and ultimately causes users to resent WordPress's behavior).

11/09/07 03:46:22 changed by josephscott

I've been trying to reproduce this with no luck. I suspect that r5758 fixed this for us back in June.

11/09/07 06:51:16 changed by redsweater

When I do a getCategoryList against my test blog on Wordpress.com, I still get the Blogroll item:

<value><struct>

<member><name>categoryId</name><value><string>1356</string></value></member> <member><name>categoryName</name><value><string>Blogroll</string></value></member>

</struct></value>

Wouldn't the Wordpress.com install have the fix from June that is alleged to have fixed it?

(My test wordpress.com blog: http://sweatertest.wordpress.com/)

11/09/07 18:45:55 changed by redsweater

  • status changed from new to closed.
  • resolution set to fixed.

It looks like the Blogroll item I described above was a fluke. Somehow in my testing I must have selected that Blogroll item from the list and thus caused a real Blogroll category to get created on my Wordpress.com test account.

I tested against a clean 2.3.1 install and the bug does appear to be fixed! Nice.

11/09/07 21:44:33 changed by lloydbudd

  • milestone changed from 2.4 to 2.3.