开发者

Issue with "modify taxonomy"

开发者 https://www.devze.com 2023-01-13 03:02 出处:网络
I\'m working with Drupal 6 to create a feed collecting site. I import the original feeds via the feeds module and copy their tags. But I also want to assign a category (terms from second taxonomy) acc

I'm working with Drupal 6 to create a feed collecting site. I import the original feeds via the feeds module and copy their tags. But I also want to assign a category (terms from second taxonomy) according to the author name to be able to divide the content in a unified way.

I want to use the rules module (rules-6.x-1.2) to assign these categories开发者_开发技巧 upon import. I use the following steps:

ON event Content is going to be saved

IF textual comparison ([node:author-name], TheAuthorName)

DO Modify node taxonomy terms (saved content, permanently, add the selected terms)

I select the terms to be added as "-none selected-" for tags and "TheCategory" for categories.

Now, when I import the feed, the category "TheCategory" is added to the content, but the tags vanish.

This happens also if I select "Replace existing terms with selected ones" or "Replace terms within same vocabulary" for the action. Upon editing, always the radio button of "add …" is selected, regardless of what I entered previously. And yes, I clicked on "save".

Is this the right way to do what I want? Why isn't it working? Could I do this with another module maybe (I don't need rules for anything else …)?

Thanks for your help!


Ok, so I found out that the right trigger to do this is "new content is created" (which I somehow couldn't get to work beforehand).

So, I ran the rules module in debug mode and found that the rule was triggered, the filter returned TRUE and the modify node taxonomy action was successfully accomplished. But the taxonomy was entirely unchanged.

I played around a little and postponed a "save content" action on the newly created content. Turns out, this fixed the problem and now everything works as I intended.

Still, there are some flaws:

  • I checked "permanently apply changes", but it did not do anything.
  • I unchecked "permanently apply changes", but upon editing again, the box was checked again (probably the setting was not saved to begin with)
  • The same holds true for the radio buttons for the type of "modify node taxonomy" action which was obviously not saved

Maybe this can help someone.

0

精彩评论

暂无评论...
验证码 换一张
取 消