Closed (fixed)
Project:
Project
Version:
6.x-1.x-dev
Component:
Releases
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
10 Dec 2010 at 03:55 UTC
Updated:
3 Jan 2014 at 02:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mikey_p commentedtagging
Comment #2
mikey_p commentedComment #3
dwwYup sounds great. I'm happy to see this split out from #986718: Add support for sandbox projects since that patch is already getting pretty big. ;)
Thanks,
-Derek
Comment #4
dwwadding tag
Comment #5
dww#986718: Add support for sandbox projects landed. This can now happen.
Comment #6
mikey_p commentedHere's a start at this, I think we're fairly close, but this is fairly dependent on the UI over at #986718: Add support for sandbox projects so as that gets refined we may need to make a few changes here as well. For now, here's what this patch does:
A) Adds an option to admin/project/project-settings for setting the default behavior of releases
B) Alters the nodeapi_insert hook so that the above setting is checked and the correct value is used when created a new project if it is a sandbox
C) Alters the node/%project_node/edit/releases access callback to check to see if releases are disabled for sandboxes and if the project is a sandbox, and hides the releases tab
D) Adds a checkbox to the project promote form if releases are disabled for sandboxes that shows the current status of releases for the project
E) Adds a submit handler to update {proejct_release_projects} when submitting the promote form
Comment #7
mikey_p commentedneeds review
Comment #8
eliza411 commentedTagging for Git Sprint 7.
Comment #9
eliza411 commentedTagging for Git Sprint 8
Comment #10
dwwMostly looks good. A few nits:
A) These functions need the word "alter" in their names:
B) Instead of duplicating this whole query, I'd rather just initialize a variable that holds the value for releases in a conditional and then have one query:
I generally find queries a bit hard to scan and see differences. I think it makes the code clearer if we just conditionally define $releases in the if and then have a single query with that as the argument.
C) I generally find variables that are named and behave in the negative a bit harder to grok in the code, since you often do double-negative logic with them. I think the code would probably be clearer if the variable was actually called something like project_release_sandbox_allow_releases and the UI was changed to reflect that.
Frankly all of these are just cosmetic optional fixes for code legibility. So, I almost hate to set this to 'needs work'. But, they should be very quick to fix (at least A and B). I leave C up to you, just wanted to raise it but I don't consider it a blocker for a commit.
Comment #11
mikey_p commentedRerolled this patch, and made all the changes in #10 and fixed a small logic issue in the access control for the releases subtab, where nodes that already have releases enabled show that tab regardless of the setting and sandbox status.
And yes, C is probably a very personal thing, since it seem a bit harder for me to grok now. Doing
!variable_get('project_release_sandbox_allow_release', TRUE)seems to be more of a double negative than having the variable be more descriptive, but it doesn't really matter that much to me.Comment #12
dwwLooks good. By my tastes, #11 is easier to read re: C. ;) Go figure... ;) Anyway, commit at will.
Comment #13
mikey_p commentedCommitted.