python-wordpress-xmlrpc icon indicating copy to clipboard operation
python-wordpress-xmlrpc copied to clipboard

<Fault 500: 'Empty Term'> - taxonomies

Open rosscdh opened this issue 10 years ago • 6 comments

Hi there, thanks for the lib!

Problem when using the example: http://python-wordpress-xmlrpc.readthedocs.org/en/latest/examples/taxonomies.html#terms : Or to create a child category:

for tl_cat in top_level_categories:
    if tl_cat not in category_names:

        child_cat = WordPressTerm()
        child_cat.taxonomy = 'category'
        child_cat.parent = 0
        child_cat.name = tl_cat
        child_cat.slug = slugify(tl_cat.lower())
        child_cat.id = wp.call(NewTerm(child_cat))

results in

xmlrpclib.Fault: <Fault 500: 'Empty Term'>

any feedback would be appreciated!

Thanks

rosscdh avatar Feb 26 '15 15:02 rosscdh

running against: WP 4.1.1

rosscdh avatar Feb 26 '15 15:02 rosscdh

Please check the value of child_cat.name = tl_cat. maybe it's worth empty.

djiesamsoe avatar Mar 03 '15 07:03 djiesamsoe

Thanks, but its ok I've wrapped the database in a REST api which works quite well: https://github.com/rosscdh/wordpress_rest

On Tue, Mar 3, 2015 at 8:19 AM, Djie Sam Soe [email protected] wrote:

Please check the value of child_cat.name = tl_cat. maybe it's worth empty.

— Reply to this email directly or view it on GitHub https://github.com/maxcutler/python-wordpress-xmlrpc/issues/74#issuecomment-76898434 .

rosscdh avatar Mar 03 '15 07:03 rosscdh

yesterday I had a similar case. but in my case that occurred as a result value is empty.

so I think it could help you, but it did not.

djiesamsoe avatar Mar 03 '15 07:03 djiesamsoe

No problem I appreciate you taking the time mate thanks!

On Tue, Mar 3, 2015 at 8:32 AM, Djie Sam Soe [email protected] wrote:

yesterday I had a similar case. but in my case that occurred as a result value is empty.

so I think it could help you, but it did not.

— Reply to this email directly or view it on GitHub https://github.com/maxcutler/python-wordpress-xmlrpc/issues/74#issuecomment-76899551 .

rosscdh avatar Mar 03 '15 07:03 rosscdh

I fixed it. The problem occurs (for me), when a tab/category is empty. So when you exclude empty valued, the problem disappears. For me it was somehing like

[i for i in tag_generator() if i]

Through the if i, empty values are excluded and it works now!

oesah avatar Aug 06 '15 19:08 oesah