Closed (fixed)
Project:
Project
Version:
6.x-1.x-dev
Component:
Releases
Priority:
Critical
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
18 Nov 2006 at 01:43 UTC
Updated:
2 Jan 2014 at 23:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dwwin addition to book's use of $node->pid, in my original post, the same kind of bug is causing lots of other pain.
http://drupal.org/node/124846
http://drupal.org/node/142208
http://drupal.org/node/145782
...
as per recent email on the devel list, the best solution is for project* to defend itself by using it's own namespace in the $node object. something like an array, named by the module loading the stuff into $node:
Comment #2
Jürgen Depicker commentedsubscribing. I wrote a patch for casetracker (renaming table columns and vars to no longer use pid but ctprid). I'll see what the results of this discussion will be, and will roll another casetracker patch using the same solution as what you decide over here. Thanks Derek!
Comment #3
czarphanguye commentedThe next step for those not included in this dev conversation is...? I imagine its wait until the next release, is this accurate?
Also, may you have any odd jobs a not-so-elite coder can help with?
Comment #4
czarphanguye commentedAny fix/patch?
Comment #5
czarphanguye commentedOK! I'll stop being lazy and play around with fixing this pid issue in project_release.
Mind you, I'm just searching and replacing, yet my releases Now Work *knock on wood*. Simply replaced pid for pro_id. Also changed MYSQL table project_release_nodes pid to pro_id.
Patch attached (note I'm using 5.x-0.1-beta)
Comment #6
Jürgen Depicker commentedA pitty you didn't use the best way, which is to use a proper namespace per module inside the $node object as mentioned by dww. Could you not update your patch accordingly? I'm sure this is the way to go, and this is the way which would be unanimously accepted!
I am busy reading Pro Drupal Development (excellent, really excellent) but noted also there in the examples variables get just assigned without worrying too much about possible other modules using the same variables, like on p 209 where global variables are created $last_change and $last_id. This really is an issue which deserves the attention of all developers, and it should probably be mentioned somewhere at the start of any developer's manual: a standard way of defining variables used by a module, global variables or variables inside other objects like $node.
Comment #7
czarphanguye commentedtbh I'm not sure what dww's and your comment about 'proper namespace per module' exactly means. What I've been doing is replacing
pidw/pro_id. Are you saying that I can simply search and replacepidw/project_release['pid']?Anyhow, until I understand the name space game a little better here's another patch for project.module to work with the above project-release module changes of
pidtopro_idas the project was having issues displaying the correct release on the */project page.Comment #8
Jürgen Depicker commentedWhat dww means (and me too) is that it looks much cleaner if every module doesn't pollute $node arbitrarily, but instead keeps all its variables properly stored in a separate namespace, like $node->module_name[var_name], so I think yes, simply search and replace pid w/ project_release['pid'].
Comment #9
dwwi'm partially waiting to see the results of http://drupal.org/node/148420 before i spend much time on this, since it'd be nice to just do it consistently with however core ends up doing it for D6.
however, we're still going to have to do something for 5.x (and perhaps 4.7.x, too). my preference is what i said in comment #1 above: each of the project* modules maintains its own array in the $node object for *everything* it's putting into and getting out of $node. so, it's not just about search/replace
$node->pidwith$node->project_release['pid'], it's checking everywhere all of the project-related modules touch $node, and fixing hook_nodeapi('load') for all of them. no schema changes required or desired (the column can and should remain "pid" in the DB), this is just about changing how we populate the $node object and where we look for the stuff we put there.does that make sense?
thanks,
-derek
Comment #10
drewish commentedyou postponed #148420 so it looks like we'll just take care of it here.
here's a first pass on the project module. it still needs lots of work.
Comment #11
criznach commenteddww asked if I could find a regex to fix some of these namespace issues. I've identified cases where there are potential namespace conflicts. I went throught the schemas and pulled any non-node-native fields that are potentially assigned to node objects. Here's what I've found so far...
Comments are also a potential problem because they're merged in hook_comment. This could clash with other modules, so I'll go ahead and find those cases too.
I'm going to attempt to auto replace and add tracing comments to these this evening.
If anyone sees any conflicts or holes in the above list, let me know. This really seems like it could be a best practice that should be added to the handbook pages on node-type modules.
Comment #12
criznach commentedAdding project releases...
Comment #13
criznach commentedHere is the first of two bulk-replacement patches.
Changes are marked as follows...
Comment #14
criznach commentedAnd the second...
Comment #15
dwwGreat, thanks! Can you post your script, too? That'll be more useful long term than this patch, which will soon not apply anymore. Plus, we'll want to make similar changes to both DRUPAL-5 and HEAD at least... Thanks again!!
Comment #16
criznach commentedI ended up not using a script. I did it all with regex replace in komodo. But I can post the basic regexs here...
Here's the find pattern:
This finds lines containing an assignment of $node->property where property matches one of the OR list. I pulled the OR list from the .install files and excluded node-native fields like .nid. It excludes comment lines so it can be run multiple times. The disadvantage to this pattern is that it won't find multiple matches per line, so you have to run it multiple times until there are no more matches. I think there are a few extra parenthesis, but it seems to work. The modules installed on the first try.
I replace that with something like this:
That insterts a comment line saying what was replaced, then on the next line rebuilds the line from the extracted parts, inserting the project array into the assignment.
I also wrote one to remove all but the field name from the copied and pasted schema definition. Just copy and paste the fields you want.
It could easily be a perl script, but it seemed easier to do manually at the time.
Comment #17
criznach commentedI'm going to assign this to myself it no one objects. I've re-run my bulk replace against head and going through each change now. The regex was definitely not fool proof, but it was a good start. If anyone gets impatient, I can post the latest patch, but it's broken in a number of areas.
It brings up an interesting point... Since loading properties into the node object in hook_load or hook_nodeapi is accepted practice, any module could easily create this conflict. We could try to automatically fix, with a "namespace" array or object for each module, but... Creating a "namespace" array or object would break most hook_validate implementations because hook_validate doesn't correctly build the node object with the namespace variables. hook_validate assumes that the node's structure is identical to the node form's structure. I haven't tried setting the form #tree property to true yet. That might help make hook_validate more agreeable. To get around this for project, I chanaged the hook_validate call to a standard validate($form_id, $form_values) function.
Comment #18
dww@criznach: Thanks, that's great!
FYI: see http://drupal.org/node/148420 about trying to fix this for real in core. Short version: it was too big and complicated to try to change in D6, so it's going to have to wait until D7. I hope someone decides to tackle it early in the development cycle. Perhaps it'll factor into the work for the (currently vaporware) Data API...
Comment #19
criznach commentedYeah, the first big breaker I saw was the hook_validate stuff. It doesn't currently have enough smarts to 'just work' without big changes to 5.x modules. I'll be working on this more today. I've gotten through project creation/editing and issue creation/editing so far,
Comment #20
criznach commentedI spent several hours working on the namespace array fix proposed initially and ran into one huge issue with the FAPI. I've summarized the problem here for reference, but I'll cover it below too. I discussed this with hunmonk on IRC last week.
Hunmonk proposed for project, simply prefixing the variable names with project_ so we end up with $node->project_pid. And so on... This will work well for the time being, and I'm all for it.
Thoughts? Here are the nitty gritty details for the curious...
When editiing or creating projects, project_issues, or any other node types, the FAPI automatically builds a node object for processing by node_save who's structure is determined by the supplied form tree. This means you'll typically get a flat node object coming into node_validate and node_save - even if you have created a namespace array in hook_load. There are two code paths for node object creation. One for loading and one for "reconstituting" forms.
You can create a hierarchical structure in the form tree by setting the #tree property to true in the appropriate places. The problem with this is that #tree affects entire branches, and can not be restricted to leaf nodes and leaf parents. This means that with #tree=true, fieldsets are always fully expanded and clutter the node further. Project, for example, has many fieldsets to group the UI.
One ugly workaround is to use the #parents property to manually specify how the FAPI builds the node structure. You can then place any module properties exactly where you want them in the $node object. This is ugly because it is not automatic, and will require a certain degree of thought for every property on the form.
Chris.
Comment #21
drewish commentedcriznach, I think you can work around the issue you're describing by inserting a $form['project'] with with no type and #tree = true. Its children would be the fieldsets and would have #tree = false... wouldn't that do the trick? I've gotten this working in the past but don't recall the exact details off the top of my head.
Comment #22
hunmonk commentedComment #23
dwwYeah, hunmonk just summed up much of my thoughts on this matter. I can't believe it's this hard to use an array structure, but I'm not up for a huge, complicated fight against FAPI over it, especially if all of this will probably change in D7, anyway. A flat structure with module prefixes is a reasonable interm solution, and at least it will actually solve the underlying problem. Please proceed. ;) Thanks.
Comment #24
criznach commenteddrewish: I think what I found was that a #tree=true anywhere in a branch makes that entire branch tree expand. I tried it reluctantly, because that solution - like setting #parents - adds a lot of maintenance headaches (IMHO).
I hope to get back to this over the weekend. I'd made good progress up to this issue, and now I think it should be a pretty straightforward process to get beyond. It's great to dive head first and get ankle deep in a good sized project that's not written entirely by myself. :)
Comment #25
dww@criznach: Thanks. Welcome to our world... project* wasn't written entirely by anyone. ;) It's a huge mis-match of code at this point. It's slowly evolving to a cleaner, more sane codebase, but it's going to take a long time. ;) Your help is most welcome and very appreciated!
Comment #26
criznach commentedI made some progress on this over the weekend. Project and Issue creation fields are updated and somewhat tested. I'm currently hung up on the comment system and wondering if it's even necessary to namespace comment fields at this point. My goal was to cover all of the project, project_issue and release, modules for consistency, so I'll plug away for now unless it's more important that we just get this committed.
Comment #27
hunmonk commentedplease convert the comment stuff as well -- we want consistency. in particular, i'd like to get rid of the #tree of $form['project_info'], which we can do once we stop colliding w/ comment module's pid.
Comment #28
criznach commentedOk, that's right, I do remember recognizing that and replacing the #tree with a prefixed variable name. So maybe the comment code needed a workover anyway. I'll keep plugging away.
Comment #29
mlncn commentedHello criznach, how's progress?
I rolled a very hacky patch that solves the issue with issues: http://drupal.org/node/198545#comment-673804
I'd like to help with this proper fix if I can.
Comment #30
pwolanin commentedfor both book and menu for D6, all the data is stored in a single array on the node, so unless something major changed in FAPI, I don't think it's that hard. However - all the form elements are within one fieldset for book and menu respectively.
Comment #31
criznach commentedI was away for the holidays and busy with work, so I haven't had a chance to work on this for a while. I'll try and make some time to look at the checkins since I started and try to roll a partial patch. I think the ultimate goal is to encapsulate the project properties in arrays just like what pwolanin mentioned about book and menu. That's where my work was headed.
Comment #32
micahw156subscribing
Comment #33
criznach commentedHere is my project and project issue work from several months back. It may take some work to get it up to speed, but project nodes are mostly functional, issues are mostly functional, releases and notifications are partially functional. I'm flying out Friday morning, so won't be able to sprint, but hopefully this helps.
Later,
Chris.
Comment #34
pwolanin commented@criznach - thanks for the starting patch
Comment #35
pwolanin commentedpatch for project.inc (project.module seems to have nothing that needs to change)
Comment #36
coltraneLooks good, form is set off correctly and node has project array with fields. Updating works correctly.
Leaving status unchanged cause I'm not sure if the code needs more work.
Comment #37
pwolanin commentedneeds review
Comment #38
criznach commentedGreat! I just got home to Montana from Boston. Were you able to use what I posted, or did you have to start over?
Comment #39
pwolanin commented@criznach - I just started over, since the search-n-replace was easy.
Comment #40
aclight commented#234911: Editing a release disassociates it from a project has been marked a duplicate of this issue.
Comment #41
hyperlogos commentedSubscribing. I applied the patch and it definitely did not fix my problem in bug report #234911: Editing a release disassociates it from a project.
Comment #42
pwolanin commentedWell, this patch is not complete - should probably be CNW. I got the project module itself, but not other files that may load the project node.
Comment #43
coltraneAt the Drupalcon Boston code sprint pwolanin and I discussed the project_release module and I finally have a patch to attach. This patch also needs some work because I don't think version is getting picked up correctly and saved. Peter had asked at the sprint that I at least get what I have so far up, so here it is.
This should probably be rolled into the patch for project.module but I think it needs some work still which I hope to get to soon.
Comment #44
aclight commentedHere's an updated version that:
1. Corrects a few spots in issue.inc that pwolanin missed
2. Includes a few changes to the project module that were committed since the patch in #34
3. Incorporates coltrane's patch in #43 into all of the other changes.
I initially tested the project changes on a local site and everything seems to be good. I have not tested the project_release changes at all.
Comment #45
aclight commentedSetting back to CNW because I'm getting errors in node_load() when I go to a URL such as drupal/node/111/edit where node 111 is a project_release node.
Also, I think we still need to fix the $node object usage in the project_usage module, which is also part of the project module.
Comment #46
coltraneFrom the patch in #44 there were two extra placeholders in the INSERT in project_project_insert() so here's a reroll without those. Also, I didn't get any errors after creating a release node but I'm working with the cvs module off, could that be the difference?
Comment #47
aclight commentedIt looks like the errors I described above are due to the cvslog module, so we'll eventually need to fix that module as well. But that'll be in a separate patch.
Comment #48
coltraneSorry, setting back to CNW because of project_usage
Comment #49
hyperlogos commentedApplied patch to release version, no joy. (had to do some lines manually) in fact files are no longer attached when creating releases. Going to try dev version.
Comment #50
aclight commented@drinkypoo: In most cases, patches will be rolled against code in the -dev branch, not against official releases. In the case of this patch, I don't believe anything has been committed to the project module since it was last re-rolled, so it should apply without needing any manual changes, unless you're running an otherwise patched version locally.
Also, just in case you aren't aware, the -dev branch is in development and not necessarily stable, so I wouldn't advise that you use it on any kind of production environment.
Finally, when you follow up to an issue with something like "Applied patch to release version, no joy", it doesn't really help us much. It would be great if you could explain what "no joy" means. Do you mean that the patch breaks your site, that the patch appears to not solve the $node object namespace collision, or something else?
@all: I have not tried doing much other than browsing pages with this patch applied. We should definitely check out what drinkypoo says here: "in fact files are no longer attached when creating releases".
Comment #51
hyperlogos commented@aclight: My apologies, I was going to go off and test against -dev but I got busy (still don't have time now.) So I'll go into more detail here: The current patch does not solve my problem in #234911: Editing a release disassociates it from a project, which is marked as a duplicate of this problem. In addition, as I reported above, when creating a release, the file is no longer attached.
This is the result of applying the patch to the current release version. Every hunk applied cleanly except for some which were simply not in the same place (but the code didn't appear to have changed at first glance - some of the lines in question are like 300 characters long and thus extremely hard to read. Here's what happens when I apply the patch to release:
(project.inc.rej attached)
From the .rej file and the .inc file it looks like the code is only two lines away in the current release. But of course, I haven't checked to see what else changed.
Comment #52
aclight commented#239405: unable to edit project issue - after edit project empty in issue was marked as a duplicate of this issue.
Comment #53
aclight commented#283779: problem with sorting after editing project release - urgent has been marked as a duplicate of this issue.
Comment #54
watbe commentedI have found that pathauto also conflicts with project release.
I'm really confused at the moment, what should I do to make sure that the releases can be associated to their respective projects at the moment?
Which patch should I use?
Comment #55
aclight commented@watbe: I believe that all of the patches here are incomplete and/or no longer apply, so I don't recommend using them as is. I haven't used pathauto, but perhaps it's possible to disable it for certain node types? If so, I recommend that you disable it for project, project release, and project issue nodes, since I believe that users have had conflicts with all three of these node types.
Comment #56
watbe commentedOK, thanks for clarifying.
I can't seem to disable pathauto for certain nodes so I'll post an issue in their support queues.
Comment #57
micahw156@watbe
I'm using pathauto with project* and while it's quirky, it's working for me.
For project nodes, it creates a duplicate URL, but once I delete the extra one, the one created for short project name works fine. For project issues, I just used the pattern
issues/issue[nid]. Not elegant, but not the mangled mess you get if you try to use titles, either.There's already work being done to improve project* interaction with pathauto at #229063: project* should support tokens for pathauto and others. You might want to check it out before opening a new issue somewhere else.
Micah
Comment #58
watbe commentedOk, sounds good, I'll try it out now.
Is there anyway to get project/[projectname]/issue[nid]?
Comment #59
dww@watbe (esp comment #58), please move your project + pathauto support questions to another thread, don't hijack this one. Thanks.
Comment #60
agentrickard#46 applies to 5.x-dev with a few offsets.
Testing and updating the patch.
Comment #61
agentrickardUpdated to 5.x.-dev.
Comment #62
aclight commentedUnless I'm mistaken, the project_usage module hasn't been fixed in this patch. Is there nothing there that needs to be changed?
As a note, we really need to fix this in project_issue at the same time we fix project, or otherwise project_issue won't work with project HEAD for some time. In addition, if we're going to actually fix this in the 5.x version then that's going to hold up the port of pi for that much longer, as well as mean that I have to fix this in the D6 port now. It's going to be a real PITA to fix this either way, however.
Comment #63
agentrickardRight. The current patch doesn't touch either Project Issue or Project Usage -- and probably needs to, though a comment above says to hold those for a separate patch. We also need to rename $node->components to $node->project_issue_components or put it inside the $node->project_issue array.
Attached patch adds a few fixes to Releases, putting all release information into $node->project_release.
What is the priority of fixing this issue? I jumped on it this morning thinking it was something fixable -- though painful.
Comment #64
dww@agentrickard: thanks for taking this on! Yes, IMHO this is a critical bug that keeps cropping up, and should be fixed ASAP. I forget what hunmonk, aclight and I decided in terms of exactly what branch it should go in and how we were going to handle it, and hunmonk seems to be AWOL from the project* issue queues these days, so we might just have to come up with our own plan here.
@aclight: yes, it would have been easier if this patch was finished before you started porting -- that's why I thought it was best to focus on cleaning up the crap like this in D5 before we even started real porting. But, that's not what happened, and that's life -- it is what it is. :)
I've got some fairly fire prio work to try to get done today/tomorrow, but hopefully I can come back to these sorts of things by Friday, this weekend, and/or early next week so we can get this done and committed.
Comment #65
agentrickardI'll take a look at Update and Issue, then.
Comment #66
dwwNote: we did mention this on the 5.x-1.3 project release roadmap, though I guess we didn't claim it was a must-fix before that release...
Comment #67
aclight commentedIIRC, the plan we discussed at Drupalcon was to get this fixed during code sprint day, because it was something that needed to be fixed in a lot of places and would totally require other patches to be rerolled. Some progress was made during the sprint, but it never happened. The post-drupalcon absence of dww and hunmonk from the queues for a while made me think that fixing it before porting would just lead to the port taking a very long time, if we needed to wait on namespace to get fixed, so I started to work on the port, since that's something I actually care about (namespace is a big problem, but not one that affects any of my sites).
I don't mind too much if we fix it now rather than later, but if we are planning to fix it soon then I won't consider starting the pi port until it's fixed. However there's still a lot to do with the project release and project update ports anyway, so that's not a problem right now.
Comment #68
agentrickardI would say that if we can finish the patch this week, then let's barge ahead. If not, apply to 6.x only and leave it broken in 5.x.
Comment #69
agentrickardProject Usage does not use any $node data.
The project release scripts _might_ need some attention. I don't quite follow what is going on there.
project_release_update.php performs some node handling.
function convert_release($old_release)converts data into a $node object and runs node_save, so it may be affected by these changes.project_release_nodes.php has no node handling, actually. It pulls its data from the db. Same with project-release-create-history.php and
Comment #70
agentrickardNote: I am about halfway through with Project Issue -- big change there, since it used to use an object and now it is an array.
Question: Not sure what to do about project_issue_metadata_changes()
Comment #71
agentrickardOK. Attached are three patches for the
project,project_issueandcvslogdirectories.I am running these and have caught the obvious errors. I am most concerned about issue mailings and cvslog integration, but the changes to arrays seem to work.
The $node object is now populated with the following arrays, where applicable:
Comment #72
aclight commentedHere's a cvslog patch that actually applies properly. The first hunk wasn't working right for me. Otherwise nothing changed.
I took a look at all of the patches and have a few issues with them. I tested functionality some, and haven't run across any problems.
As for getting this in, we might just want to commit it to HEAD (after review) and then work out any problems that arise there. The sooner this gets in, the better, because rerolling these patches each time something else gets in is going to be a pita.
cvslog patch: no problems found, other than the one fixed in attached patch.
project issue patch:
1. It looks like you didn't revert one of your other patches from another issue.
and
2. I'm not sure what this is doing here:
project patch:
3. Why are we moving the title and body fields out of the project fieldset? I know those properties need to stay in the $node object directly (not in $node->project[]), but I don't think that means we have to move them out of the fieldset as well.
4. I don't see where this comment and the cache_clear_all() was removed in the patch, so why are they here?
Comment #73
agentrickardProbably needs some cleaning -- I have lots of patches flying around :-). I agree we should commit to HEAD and then test.
Notes:
1) Easily removed.
2) This logic didn't make any sense to me as written, since $node->text in that instance is the project pid (a node id) and not a title string. So this seemed like faulty logic that I corrected.
3) I don't have an answer. That was inherited from pwolanin's patch, I believe.
4) Not sure.
I'll have to resync with HEAD, apply the patch and fix.
Comment #74
agentrickardPatches cleaned and re-attached.
Careful with cvslog -- HEAD of that module is D6, so the patch applies to the DRUPAL-5 branch. Other patches are against HEAD.
Issues above:
1) Fixed.
2) Original logic restored -- though I suspect a bug here.
3) Returned to the project fieldset. Watch that the #tree assignment doesn't cause issues. Seems fine.
4) Remnant from another patch, removed.
Comment #75
aclight commentedI thought it was just Eclipse that put in this stuff:
I've never seen those lines in any of the patches I create on my system (not using Eclipse). Do they actually serve a purpose? If so, what is it?
Re #2: I haven't looked at this closely, but you may be right. If so, it's best to create a new issue and not hide it in this issue.
Comment #76
agentrickardThat top line is a remnant from the HEAD/DRUPAL-5 mixup and does not belong in the patch. Revised.
Comment #77
agentrickardThe secondary bug is now at #293882: Project lookup error: mail.inc.
Comment #78
dww#293882: Project lookup error: mail.inc is now fixed, which you would see automatically if #77 was using the cool
#293882: Project lookup error: mail.incnotation. ;)Comment #79
agentrickard/me learns something new everyday.
Comment #80
scor commentedrerolled project* and project_issue patches as some hunks didn't apply any longer. I do not understand the
$node->textbusiness in project_issue/mail.inc which was supposed to be fixed in #293882: Project lookup error: mail.inc. So please check this section in the patch as I'm not sure to understand the behavior here.The cvslog patch in #76 still applies.
Comment #81
dwwI committed the followup fix over at #293882-8: Project lookup error: mail.inc. You're right, that was broken. Keep in mind, the mailhandler support hasn't been tested since I started maintaining project*, so I'm sure it needs lovin'. However, a brief skim of your latest patches here looks like you've got it right in there. I won't hold up this patch for the mailhandler case -- we can and should revive mailhandler support in another issue. Meanwhile, getting this in is basically my top priority for project* these days. Hopefully we can get a lot of eyes on this issue and a lot of testing in the next few days, shake out any potential problems, and get this committed ASAP. Thanks!
Comment #82
aclight commentedReroll of cvslog patch
Comment #83
aclight commentedThe previous version (and possibly earlier versions) of the project patch (from #80) had this:
hook_load() is supposed to return an object, so I don't understand why it was modified to return an array.
Instead, the attached patch does this:
In addition, there was one replacement that wasn't included:
Comment #84
aclight commentedAttached fixes project_project_load() and project_issue_load() just as I fixed project_release_load() in #83. It also fixes a call to project_release_load() in issue.inc that was producing fatal errors.
It looks like returning an array from hook_load() functions was first introduced by the patch in #35. It's not at all clear to me why that was being done.
Comment #85
aclight commentedUpdated versions of all 3 patches. There were a bunch of places in cvslog where the corrections had not been made. Also modified the forms created/altered in project.inc and cvslog.module to work correctly. I probably still need to investigate whether similar changes for pi and pr are necessary.
Comment #86
micahw156The patches from 85 do not cleanly apply against project-5.x-1.2 or the latest project_issue-5.x-2.x-dev (2008-Nov-17). I was able to manually apply changes for the failed hunks to project.inc, but issue.inc gets a whole lot more complicated.
The hunk for issue.inc at line 760 is supposed to change
$node->assignedto$node->project_issue['assigned']in the creation of the$assignedarray, but in current versions of issue.inc, this line is a call toproject_issue_assigned_choicesinstead. I was unable to figure out if any changes need to be made to that function.The other failed hunks in issue.inc are all pretty easy to figure out, but this one is a show-stopper for me to test.
Comment #87
gábor hojtsyComment #88
dwwThis patch is going to break far too many things to do it in the D5 version. So, we've decided to just fix this as part of the D6 port, since anything trying to touch project* is going to need to be massively rewritten after the D6 port, anyway.
I knew there were going to be a ton of conflicts between this and aclight's SVN repo of project* D6 porting, but I wanted to get his port in first, and then work on this next. Now that the bulk of his code has landed, I've started resolving conflicts from aclight's latest patches in #85 with the current HEAD of cvslog, project + project_issue. I'm done with cvslog, have 1 conflict left in project_issue, and then a bunch to handle in project itself:
8 out of 19 hunks FAILED -- saving rejects to file project.inc.rej
11 out of 27 hunks FAILED -- saving rejects to file release/project_release.module.rej
I've gotta run now, but I'm assigning to myself, since I'll work on this either later tonight or tomorrow...
Comment #89
dwwRerolled everything for current HEAD. Fixed some of the broken stuff in the patch from automated efforts (e.g. places where we were prepending ['project_release'] to $form array definitions, using the project_release array on an object we got back from a db_fetch_object() instead of a node_load(), etc, etc). Still needs a close look. Sadly, testing is going to be somewhat hard, since project + project_release are only barely functional now, and project_issue HEAD isn't ported to D6 yet at all. However, I think with a careful review and some more testing, this could go in, and if there are rough spots around the edges, we'll shake those out in further testing as we get closer to a viable release candidate.
Comment #90
dwwThose are a bit broken in places. I'm re-rolling now... stay tuned.
Comment #91
dwwOk, I'm done with cvs.module, project_issue, project_usage, and am most of the way through project and project_release... However, I just had a terrible realization: drupal_write_record() can't handle $node objects with fields in nested arrays like this at all. I have no idea if dbtng and other changes in D7 will only make this worse or not. Not sure if it's worth redoing this patch to use, e.g.
$node->project_uriinstead of$node->project['uri']and changing all the project* schema. Probably not, but I thought I'd raise it since I noticed it. It's not the end of the world to keep constructing our own queries manually, e.g. in project_project_insert(), but that's the kind of thing that drupal_write_record() is supposed to make easier.Comment #92
dwwI chatted with eaton about this in IRC, and while he agrees this is lame, we decided that for modules adding their own stuff to $node in their own arrays that they keep track of in their own tables, they can just temporarily put nid into the sub array and then call drupal_write_record() just on that. For example:
So, this isn't a show-stopper after all, and I should keep plowing ahead finishing the patches for project and project_release...
Comment #93
drewish commenteddww, your solution in #92 is exactly what i do in most of my modules... technically nid and vid, but the point is the same.
Comment #94
dwwPhew, that was a mammoth effort. I grepped through all of project* for $(node|project|release|issue) and inspected each line. I also inspected each line of the cvs diff, and found some stuff that had snunk into earlier versions of this patch that have nothing to do with this issue (and are potentially not what we want, like passing TRUE as the final argument to file_check_directory(), etc).
In project itself, without too much trouble (only 1 minor hack) I was able to get the node form to use a 'project' array with #tree = TRUE, so that even hook_validate(), hook_insert(), etc, still see $node->project['foo']. However, for the issue and release node forms, this would take a lot more work (and hacks), so I just tried to document as best I could which functions were dealing with actual $node objects, and which ones were getting a "$node" that was really a form values object. That's why if you grep with this patch applied, you'll still find instances like $node->version or $node->pid, but I'm nearly positive everything is proper.
Of course, I haven't tested *any* of this in project_issue, since that's not ported yet at all. But, I think it's best to just commit it anyway and we can fix any problems that might arise down the road. I'm spent for the night, so if anyone else wants to review these before I commit, that'd be lovely.
Thanks,
-Derek
Comment #95
dwwI hadn't gone through the project patch as closely last night, and I found a few errors and omissions. Pretty sure everything is RTBC now.
Comment #96
dwwThere were a few more lingering problems that hunmonk and I found during a final review, which I fixed. Committed to HEAD in all modules. YAY!!! This might be the most people I've ever credited with helping on a single commit:
http://drupal.org/cvs?commit=164931
http://drupal.org/cvs?commit=164932
http://drupal.org/cvs?commit=164933