Ticket #4107 (closed task: fixed)

Opened 1 year ago

Last modified 1 year ago

Tags to categories importer

Reported by: rob1n Assigned to: rob1n
Priority: high Milestone: 2.2
Component: Administration Version:
Severity: critical Keywords:
Cc:

Description

Basically, a category to tag importer that *selectively* converts categories. This is because, for example, if you have a Politics category, but have a one-time (maybe two-time) category for Iraq War, the Iraq War is more tag material, whereas the Politics category should stay that way.

So the solution that was reached in #wordpress-dev was to have the user presented with a checklist of categories, and they can choose which categories to import and which not to.

I'm planning to have it done by this weekend (weekend of 4/6).

Attachments

wp-cat2tag.2.php (4.0 kB) - added by rob1n on 04/07/07 04:47:08.
v3
wp-cat2tag.php (4.0 kB) - added by rob1n on 04/07/07 04:47:32.
v3

Change History

04/07/07 02:56:30 changed by ryan

Misc thoughts. Convert category to tag by setting the type bitfield to TAXONOMY_TAG unless the category is also a link category (link_count > 0). In that case, bitwise or TAXONOMY_TAG into the bitfield. Change rel_type in post2cat from category to tag for all posts with that category id. Copy count to tag_count and then zero out count. Link to the importer from Manage->Categories for better discoverability.

04/07/07 04:12:10 changed by rob1n

Okay, that's about 80% done. Just the bitwise stuff and count adjustments that need to be made. If you could post some examples of the bitwise stuff, that'd be great. I'm completely ignorant of bitwise functions :\.

I'll tackle the rest tomorrow morning, PST.

04/07/07 04:47:08 changed by rob1n

  • attachment wp-cat2tag.2.php added.

v3

04/07/07 04:47:32 changed by rob1n

  • attachment wp-cat2tag.php added.

v3

04/07/07 04:58:30 changed by rob1n

(In [5201]) Add initial category to tag importing. see #4107

04/07/07 04:59:58 changed by ryan

Todo: Add call to clean_category_cache(). Link to converter from Manage->Categories.

04/07/07 15:43:22 changed by rob1n

(In [5203]) Add clean_category_cache() and capability checking. see #4107

04/08/07 05:00:02 changed by rob1n

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

I think the initial work is pretty much done. We can open other tickets in reference to this one, or just reopen this.

04/09/07 06:31:12 changed by rob1n

  • status changed from closed to reopened.
  • resolution deleted.

To do -- link to converter.

04/09/07 06:35:34 changed by rob1n

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

(In [5216]) Link to categories to tags converter and UTW importer. fixes #4100 #4107

04/09/07 08:06:47 changed by glitch010101

I get the "cheatin' uh?" error when I go to use this. Doing a little googling, it seems I may have some permission issues causing that error but everything looks okay.

3 1 gNYC_capabilities a:1:{s:13:"administrator";b:1;} I'm also using a custom table prefix (gNYC_ instead of wp_), and I put my wp_cat2tags.php file in wp-admin

I'm running the nightly 2.2-bleeding from 4/9/2007

P.S. - This is my first bug here, so please let me know if I can provide more info or if this is the wrong place for this issue.

Thanks Eric Skiff

04/09/07 11:26:09 changed by Viper007Bond

Confirmed issue and I'm not using any custom permissions plugin.

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

  • status changed from closed to reopened.
  • resolution deleted.

04/09/07 16:13:58 changed by rob1n

This may be because I checked for current_user_can('manage_tags') -- not sure if that's set up.

04/09/07 16:18:17 changed by rob1n

Yep. Took that out and worked for me.

04/09/07 16:18:33 changed by rob1n

  • severity changed from major to critical.

04/09/07 16:27:23 changed by rob1n

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

(In [5218]) Just check for manage_categories. fixes #4107

(follow-up: ↓ 17 ) 04/10/07 09:45:41 changed by matt

  • status changed from closed to reopened.
  • resolution deleted.

Every time I run this it gives me this error, for every category:

Converting category #79... Category doesn't exist!

It also seems to list tags in the checkbox thing, where it should really only lists categories.

(in reply to: ↑ 16 ) 04/10/07 16:18:20 changed by rob1n

Replying to matt:

Every time I run this it gives me this error, for every category: Converting category #79... Category doesn't exist!

I *think* this is because apparently category_exists return the category ID on success, and also it takes the nicename. I'll add in a function local to the importer class that checks based on ID, and returns either boolean true or false.

It also seems to list tags in the checkbox thing, where it should really only lists categories.

This is just my stupid mistake :\.

04/10/07 16:57:23 changed by rob1n

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

(In [5229]) Use own category_exists() function, and only list categories to convert. fixes #4107