although cvs has blogapi working again to the point that i can use Ecto to post messages,

categories don't work anymore. they appear in ecto, i can choose them, but they won't upload to the site.

CommentFileSizeAuthor
#20 taxonomy-node-save.patch636 byteswalkah
#19 blogapi_3.diff920 bytesthumb
#15 blogapi_2.diff846 bytesthumb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

Title: categories don't work. » blogapi categories don't work.
kvarnelis’s picture

reverting back to 1.71 eliminates this problem. upgrading to 1.72 introduces it.

moshe weitzman’s picture

Priority: Normal » Critical

set to critical since blogapi is holding up the release candidate. here is our xmlrpc call and response as seen from ecto console. i can't spot the problem. can anyone else?

http://drupal.pastebin.com/629547

moshe weitzman’s picture

in ecto, i don't even get the list of categiries back from the server. this works fine in performancing though. upon submi of new post or edit, categories are indeed not recorded.

alliax’s picture

I'm sorry if this is stupid but I'm really not good at anything so please bear with me, the only thing I can see is :
categoryNameUnited States of America
categoryId2

in the categoryID the number 2 may be a numeric value instead of a string, so that may be that, MAYBE.
Otherwise I checked all your xml call and there's no problem with opening and closing tags.

moshe weitzman’s picture

Priority: Critical » Normal

categories actually worked for me using performancing blog client for firefox so this may be an ecto thing. needs investigation. downgrading.

samc’s picture

I've had problems using categories and w.bloggar. The w.bloggar client can pull my category list, and I can select categories, but the categories are applied incorrectly. More precisely, the categories that are applied to the node in Drupal are not the ones I chose in w.bloggar.

I have no idea where the problem is, and don't think w.bloggar has any kind of console as far as I've seen.

thumb’s picture

Version: x.y.z » 4.7.0-rc2
Priority: Normal » Critical

I'm seeing this issue also and have posted to the Ecto support forum. I've reverted back to 1.71 as noted above, and it does fix the problem.

Looking at the diff shows a block removed, is the fix as simple as putting that block back in?

http://cvs.drupal.org/viewcvs/drupal/drupal/modules/blogapi.module?r1=1....

thumb’s picture

Silly me, of course it's not that easy :( Hope someone has some time to look at this.

thumb’s picture

Actually, reverting back to 1.71 borks Ecto's ability to retrieve posts :(

I'll try to take a look at this and see if I can figure it out, but I have no expience with Drupal, let alone the blogapi.module.

dmitrig01’s picture

I think the problem might have something to do with the

 $terms = module_invoke('taxonomy', 'node_get_terms', $node->nid, 'tid'); 	 
   foreach ($terms as $term) { 	 
     $node->taxonomy[] = $term->tid; 	 
   }

line of code removed in the diff

thumb’s picture

Status: Active » Needs review

Okay, here's a patch. Seems to have fixed things for Ecto, but I have no idea about other clients.

Index: blogapi.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blogapi.module,v
retrieving revision 1.80
diff -u -u -r1.80 blogapi.module
--- blogapi.module 30 Mar 2006 21:30:25 -0000 1.80
+++ blogapi.module 9 Apr 2006 05:26:49 -0000
@@ -282,6 +282,12 @@
$node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
}
$node = node_submit($node);
+
+ $terms = module_invoke('taxonomy', 'node_get_terms', $node->nid, 'tid');
+ foreach ($terms as $term) {
+ $node->taxonomy[] = $term->tid;
+ }
+
node_save($node);
if ($node->nid) {
watchdog('content', t('%type: updated %title using blog API.', array('%type' => ''. t($node->type) .'', '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));

killes@www.drop.org’s picture

I want this addressed in 4.7. I am no blogger though, so somebody else has to test this.

Zen’s picture

Status: Needs review » Needs work

Please submit patches as a patch file.

-K

thumb’s picture

FileSize
846 bytes

Whoops, here ya go.

moshe weitzman’s picture

is this patch in edit_post()?, if so, this strikes me as attacking a symtom and not addressing root cause. why would node_load() not return $node->taxonomy for us? that was added a long time ago in HEAD.

ps - if possible use the -F flag in your diffs as recommended at http://drupal.org/diffandpatch

dmitrig01’s picture

Status: Needs work » Reviewed & tested by the community

i changed it because there is a good patch ready to be commited.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Needs review

a patch is ready after several people read it and test it. that hasn't happenned for this patch, or at least noone has said that they tested it.

thumb’s picture

FileSize
920 bytes

moshe, yeah, I'm definitely attacking a symptom and looking for a quick fix. I'll do a bit more to get familiar with this, but if a core developer has time, they'd probably be able to diagnose what's going on much quicker than I.

I'm wondering how changes to this module are tested. Obviously, ecto/drupal wasn't tested for 1.72. Is there a test matrix around for this module? I'm only familiar with a few Mac-based desktop blog clients that I imagine aren't that large of portion of what needs to be tested.

Thanks for the link on diff, I'll be sure to follow your advice in the future.

walkah’s picture

FileSize
636 bytes

in the interest of fixing the cause instead of addressing the symptom... here's the story:

yes, node_load() absolutely prefills $node->taxonomy ... as an array of $term *objects*. the issue here is that taxonomy_node_save doesn't actually account for when it's $terms are an array of object... it either expects an array of arrays (i.e. from a form submission) or an array of tids.

I've attached a small patch that should make this silent node_load -> node_save() scenario work better.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

looks good to me ... lets not turn this into a big project to standardize object vs.array.

killes@www.drop.org’s picture

Status: Reviewed & tested by the community » Fixed

I am not particularly happy with it, but I comiitted it.

Anonymous’s picture

Status: Fixed » Closed (fixed)