Closed (duplicate)
Project:
Decisions
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Aug 2009 at 07:36 UTC
Updated:
10 Aug 2009 at 08:13 UTC
There are differences between the loaded object (hook_load) and the hook_update process : Decisions settings values are lost if a Decisions node type is loaded and saved. For example : a Decisions node updated with the Workflow module.
patch
Here is a patch trying to fix these elements :
1. Update a node loaded (node_save($node) does not erase any data)
2. Revert default checkbox "No end date" value
3. fix hook validate for Choices validation : force to 2 choices minimum.
| Comment | File | Size | Author |
|---|---|---|---|
| decisions_node_load_validate.patch | 6.24 KB | pierre75 |
Comments
Comment #1
anarcat commentedSo again, you seem to be completely ignoring the issue #514562: Allow creating decisions programatically and while I really appreciate you contributing to the project, I would also appreciate if you would actually avoid creating duplicate issues. If the patch in the other issue is improper, please say so *in the other issue* so that the original poster of the issue can also comment and review it. Now I have to update two issues instead of one and it makes my work harder and less desirable, which in turn makes your patch less likely to get into CVS.
So what you need to do now is to post your patch in the issue #514562: Allow creating decisions programatically. But before that, you may want to fix the following issues:
Indentation is wrong there.
Here too.
Same here.
That *may* be a good idea, but I'm not sure it actually works: the $node->runtime variable is changed in the function but the $node is not passed by reference, then you reuse that variable outside the function:
That seems wrong to me.
Also, as a rule of thumb, I don't generally refactor code if it's duplicated once. It's at the third instance I refactor. So it would probably be simple to just put the function inline.
I also need a way to test this. Please provide some test script to show me what the current problem is and how to test it is really resolved.
Finally, please make any further updates in #514562: Allow creating decisions programatically. You can reupload your patch there and it's the proper issue to follow up on. I'm closing this as duplicate, as I have already told you about this in #532242: some decision settings are not saved properly. Thank you.
Comment #2
stevenpatzComment #3
pierre75 commentedI am so sorry : I thought you want me to do exactly the opposite, which is totaly illogical. Definitly, I need holidays :)
1. ok for indent (it is very strange : it is ok in the code before creating patch)
2. Function _decisions_enddate_calc: ok, I just put it in case of it were a good idea (it is easy to delete) ; for me it works
3. Collapsed menu : it is collapsed when there is non end date provided, isn't it ? i.e when runtime == DECISIONS_RUNTIME_INFINITY. Am I wrong?
4. To test this:
- point 1 : make a node_save(node_load($nid)) and compare settings fields before and after
- points 2 and 3 : simply insert and update a decisions node
I will update #514562, I promise :)
Thank you.