Needs work
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Core
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Jun 2009 at 20:16 UTC
Updated:
9 Jan 2019 at 00:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
AlexisWilke commentedWe actually need to delete the hierarchy entry with the given TID and Parent = 0.
New patch attached.
Thank you.
Alexis
Comment #2
fagoHm, I don't like fiddling around in foreign database tables. This should be done by API if possible. --> http://api.drupal.org/api/function/taxonomy_save_term/6
Ideally we should make the taxonomy_term data object savable, as noted in #456328: Taxonomy actions: Add/Delete term
Comment #3
mitchell commentedComment #4
tngcas commentedWas this ever implemented? Does anyone know how to assign a parent term to a newly created taxonomy term in rules?
Specifically what I need:
Action: 'after saving new term'
Do: Assign child term to newly created term.
Comment #5
tngcas commentedI have temporarily implemented this patch... so far it is working as designed. I will report any problems.
Comment #6
AlexisWilke commented@fago,
Btw, there is no taxonomy functions in taxnomy.module that would look like helper functions to do this work. It works for me and tngcas now. Maybe you want to re-review this? If you find a function that tweaks the hierarchy that doesn't take a $form_values as input, I'll be happy to look into it.
Thank you.
Alexis
Comment #8
AlexisWilke commentedNew version against 6.x-1.4 which I would imagine is really close to 6.x-1.x-dev.
Let's see if the patch applies to the lastest checkotu of the code-base (see http://qa.drupal.org/pifr/test/123584 )
Comment #9
fagohm, what about making use of taxonomy_term_save() by casting the term object to an array before?
Anyway, in the meantime rules2 is in dev so we need to make sure new features work there, before we can backport them to d6.
For d7, I think we should just make sure we can manipulate term:parent accordingly via the generic list actions.
Comment #10
candelas commentedany news about this implementation?
it will help a lot with managing sections of magazines that are organized by taxonomy.
thanks for all your work :)
#edit: i used the patch and it works in drupal 6.20
thanks a lot, i had a night mare with taxonomy and i discovered rules but i was not able to do this.
it would be nice to have an action for deleting to apply when a term is deleted.
now i go to see if coping your patch i can do the same with related terms.
my need: when i create a magazine, i need to create the sections and relate to the sections of previous magazines.
thanks thanks :)
if i am suscesful with related terms, i put the code here :)
Comment #11
candelas commentedit worked!!
thanks for what i learn from both of you, AlexisWilke and fago :)
i am sure you will implement it much better than me but for my night mare for the moment it is enough and it is not complicated for an update on your module on the site that i am building.
I put the code just under the AlexisWilke lines.
please, take into acount that i am not an expert :)
Comment #12
candelas commentedhello again
i am very excited this morning playing with rules.
sure that i am not doing it as good as if i was using it for a while but i am very happy :)
i tell here one idea, just in case AlexisWilke wants to take it into account and implement it... :)
or anybody in the community...
my case is that i create a magazine and when it is created, i create terms that refer to the sections.
then i assign the parent to each term.
so i do a very repetitive rules.
load vocabulary, add term, load term (which will be the parent) and assing the parent.
if in AlexisWilke code, i could assing vocabulary->term, since i have loaded the vocabulary already, then i wouldnt need to load a term each time for it to be assigned to the child.
i wish i had the knowledge to do it and add it here... but at the moment no.
it would be a pleasure to me to be able to return a bit of what i got from you :)
thanks and i will have an eye on rules for future sites: its great!!!
Comment #13
AlexisWilke commentedcandelas,
Somehow, pretty much all my patches have been refused (not applied) by the author of rules. So I don't feel compelled in helping more for having to apply perfectly working patches forever.
Thank you.
Alexis
Comment #14
jvieille commentedThank you so much for this great patch.
Can it be committed?
Thanks
Comment #15
mitchell commented>> Somehow, pretty much all my patches have been refused (not applied) by the author of rules. So I don't feel compelled in helping more for having to apply perfectly working patches forever.
I know exactly what you're talking about. Jokingly put, "you have stayed on 6.x longer the issue queue maintenance policies have allowed." ;P
After some thought, the best thing that you can/should do is start a Rules-6.x-1.x sandbox fork. Try to maintain the quality and work in direct correlation to the patches posted in Rules's issue queue. ... And defend issues from hijackers (#486168: How to: diagnose problems sending email) by moving them to your Rules 6.x fork if you have to.
It's a lot easier to maintain the code and support the interested users and get feedback with your work. This would also save fago a ton of time when you want larger, tested pull requests.
Comment #16
yogaf commentedAdding taxonomy action: Assign parent term to term.
against 7.x-2.2
Comment #18
yogaf commented#16: assign_parent_term_to_term-490892-16.patch queued for re-testing.
Comment #20
yogaf commented#16: assign_parent_term_to_term-490892-16.patch queued for re-testing.
Comment #22
lyricnz commentedThe Rules Core Integration failure appears to be unrelated to this patch - I've created a new issue for that - #1837644: RulesIntegrationTestCase::testSystemIntegration() can fail
This patch needs a test too.
Comment #23
yogaf commented#16: assign_parent_term_to_term-490892-16.patch queued for re-testing.
Comment #25
yogaf commented16: assign_parent_term_to_term-490892-16.patch queued for re-testing.
Comment #26
yogaf commentedPlease commit.
Comment #27
yogaf commentedComment #28
joelpittetComment #30
tr commentedRe-tested patch and it doesn't apply anymore. So I re-rolled it against current HEAD. I also fixed some coding standards errors that I noticed were being introduced by the patch - let's see if the testbot finds any more.
Comment #31
tr commentedAnd yes, the testbot caught 10 additional coding standards problems. Here's a new patch that should fix those. I also noticed that the patch changed filemodes for three files, so I removed that part too.
Comment #33
tr commentedTestbot is saying
error: dev/null: No such file or directoryI don't know what that means. Retest gives the same result. Maybe the testbot is malfunctioning. Anyway, uploading the patch again to see if that helps...
Comment #34
tr commentedStill some coding standards problems ...
Comment #35
tr commentedOK, testbot says that the patch in #34 doesn't add any new coding standards violations.
Comment #36
tr commentedAs mentioned in #22, needs tests.
Comment #37
tr commentedRe-rolled #34 against current HEAD. Still needs reviews and tests.