Thanks to http://drupal.org/node/197186, update(_status) will soon understand it when a maintainer wants to support multiple branches for the same version of core. As I wrote at http://groups.drupal.org/node/7440 :

Fundamentally, the problem is that the notion of the "recommended version" is being overloaded to mean too many things:
- The version new users are suggested to download via the project browsing pages.
- What you see on the front page of the project node.
- If people should drop an older release and upgrade because their series is no longer supported

So, now we need to design and implement a way for project maintainers to specify when a branch is supported or not.

The current patch for update(_status) assumes there will just be a new term in the "Release type" vocabulary called "Unsupported". However, it's clumsy to have to manually update all the release nodes, even if we stick with that vocabulary for the underlying implementation and storage mechanism for this info. Although, the patch also depends on a <supported_majors> tag in the XML release history file, so, so long as that's defined, we don't necessarily need the "Unsupported" term.

Some possible approaches:

A) If you mark the -dev snapshot node for a given release series with "Unsupported", all the other release nodes in the same series are updated automatically. This is kinda lame since it forces you to have a -dev snapshot for any branch. OTOH, there might be other goodness to representing branches in the project UI via the -dev snapshot nodes. Again, see http://groups.drupal.org/node/7440 about this.

B) Put something on the node/N/edit/releases subtab for manipulating this stuff. Mockups welcome if we go this route.

Let's use this issue specifically for the question of the project maintainer UI for all of this. We can leave http://drupal.org/node/176776 for the changes to the download table in the public-facing project node UI.

CommentFileSizeAuthor
#60 project_203313_releases_table_26.patch41.51 KBdww
#59 project_203313_releases_table_25.patch40.14 KBdww
#58 project_203313_releases_table_24.patch40.12 KBdww
#55 project_203313_releases_table_23.patch37.58 KBdww
#53 project.patch38.32 KBstarbow
#51 project.patch39.45 KBstarbow
#50 project_203313_releases_table_22.patch37.9 KBdww
#49 project_203313_releases_table_21.patch38.61 KBdww
#48 project.patch39.45 KBstarbow
#45 project_203313_js_A_initial.png87.91 KBdww
#45 project_203313_js_B_unsupported-1.png87.15 KBdww
#45 project_203313_js_C_update.png165 KBdww
#44 project_203313_releases_table_20.patch37.18 KBdww
#41 project_203313_releases_table_19.patch37.15 KBdww
#40 project.patch36.79 KBstarbow
#38 project_203313_releases_table_18.patch36.7 KBdww
#37 project.patch36.64 KBstarbow
#35 project_203313_releases_table_17.patch35.58 KBdww
#32 project_203313_releases_table_16.patch35.65 KBdww
#31 project_203313_releases_table_15.patch33.3 KBdww
#28 project_203313_releases_table_14.patch32.51 KBdww
#26 project_203313_releases_table_13.patch31.81 KBdww
#25 project_203313_releases_table_12.patch29.02 KBdww
#24 project_203313_releases_table_11.patch28.71 KBdww
#23 project_203313_releases_table_10.patch28.65 KBdww
#22 project_203313_releases_table_9.patch27.73 KBdww
#21 project_203313_releases_table_8.patch27.99 KBdww
#15 project_203313_releases_table.patch_7.txt20.65 KBdww
#15 project_203313_releases_table.patch_7.png164.01 KBdww
#14 update_197186.patch_7.txt17.98 KBdww
#13 project_203313_releases_table.patch_5.txt15.7 KBdww
#12 project_203313_releases_table.patch_4.txt5.97 KBdww
#11 project_203313_releases_table.patch_3.txt15.63 KBdww
#10 project_203313_releases_table.patch_2.txt15.52 KBdww
#8 203313-UI-1_table_recommended_snapshot_2.png71.19 KBdww
#7 203313-UI-1_table_recommended_snapshot.png72.67 KBdww
#6 project_203313_releases_table.patch_1.txt12.83 KBdww
#4 project_releases_table.patch9.7 KBdmitrig01
#3 203313-UI-1_table_recommended.png68.15 KBdww
#2 project-edit-releases-tab.png159.59 KBdww
#2 203313-UI-2_tables.png63.19 KBdww
#2 203313-UI-1_table.png67.54 KBdww

Comments

michelle’s picture

Quick thought... On the releases tab there is what looks like it would be a table of releases? (I have a new module that is only in dev so I'm guessing). How about a dropdown on each one to label it with its status?

Michelle

dww’s picture

StatusFileSize
new67.54 KB
new63.19 KB
new159.59 KB

Well, yeah, what you get now, if you have multiple versions of core, and multiple branches for each one, is a table that looks like the attached screenshot (it's the one for signup, which has 2 branches for 5.x).

That won't work for the whole new UI, but it might work for the "Recommended version" part of it. We're still only going to have 1 recommended version for each version of core, as per http://groups.drupal.org/node/7440 :

After thinking about it more, I believe there's still value in the notion of a single recommended release for each core API. However, this needs to be more strictly defined. It should only mean "what version the maintainer thinks new users should download". So, this will be the single release listed with the project teaser on the various browsing pages. This will also be marked as such in the project node and update_status UI. However, update_status will NOT automatically warn you to upgrade if you're running a different version. update_status will only warn you if your release is specifically marked as insecure, abandoned, or unpublished.

So, in addition to the screenshot of what's there now, here are 2 proposed UI mockups.

First is a "2 tables" approach, where you have 1 table to define the supported major versions for each version core, and then a 2nd table, almost exactly like the existing table, to define the recommended version for each version of core that has any supported branches. You only get a drop-down if there are multiple supported branches. Since there are no supported major versions for 4.6.x, there's no row for 4.6.x in the "recommended versions" table. However, since there are 2 supported branches for 5.x (5.x-2.* and 5.x-3.*), you get a dropdown to select which one is recommended. For 6.x and 4.7.x, since there's only 1 supported branch for each, there's no dropdown -- the recommended has to be the only one that's there...

The final image is a (IMHO, pretty crazy) version where you get a single table for each version of core, and you define both supported and recommended in the same table. It's wonky, but at least it's here as a straw-man proposal for feedback, and there might be elements of it that inspire a cleaner approach.

dww’s picture

StatusFileSize
new68.15 KB

Here's a (perhaps) better version of the 1-table-per-core approach. Since there's only 1 currently recommended version per core, it shouldn't be in the table at all...

dmitrig01’s picture

StatusFileSize
new9.7 KB

Here's a patch that does the looks

dww’s picture

Thanks for starting this. A few implementation gripes:

A) s/core/api/ -- "core" is specific to d.o. in project_release, internally, we always call this the "api compatibility term", $api_tid, api_vocabulary, etc, etc.

B) Incorrect use of t(): array(t('Major version', 'Supported'))

C) theme function doesn't deal with 'Recommended' at all.

D) seems like the advanced settings (which have nothing to do with the recommended/supported data structure) should be handled directly in project_release_project_edit_form(), and the helper form builder function should be specific to the crazy table UI stuff.

E) _project_release_project_edit_form_getdef() should be renamed to something more self-documenting, like _project_release_get_version_major_data() or some such. Obviously, that function is bogus, and needs a db_query() to figure that stuff out. A // TODO comment to that effect would be nice. ;)

F) '#core_name' is used in the theme function but no where else...

But, this is certainly the beginnings of a great patch. ;) Thanks!!

dww’s picture

Status: Active » Needs work
StatusFileSize
new12.83 KB

New patch with project_release.install changes for schema update (tested on MySQL, coded for pgsql, too). Otherwise unchanged from before.

dww’s picture

StatusFileSize
new72.67 KB

Upon further thought, we should probably let maintainers specify dev snapshots per major/branch, not just a single bool for the project. I hope this doesn't make the UI too busy/confusing -- I think it works. If we go this route, we'll need more schema (and code) changes, but I think it's worth it.

dww’s picture

Whoops, a few bugs in the previous mockup. Use this instead.

drewish’s picture

maybe there's another issue for it but how would the HEAD branch factor into this? in the screenshot in #6 has HEAD been renamed to 6.x? or did you just omit HEAD.

dww’s picture

StatusFileSize
new15.52 KB

@drewish: As far as project_release is concerned, what matters if the version info in {project_release_nodes}, not what branch/tag each release node happens to be pointing to. The evil HEAD release nodes from before the new release system don't really factor in at all, since they don't have valid version info. They don't show up on the project node, nor the project browsing pages. Only once they have a "Drupal core compatibility" term associated with them, and real version info, do they matter... Whether or not a release node is pointing to HEAD or another branch is irrelevant. All that counts is if that release has valid version info or not.

@all: Here's a new patch for project_release.install that includes a (completely untested) DB update to move the snapshot stuff from per-project to per-branch. It's also smarter about populating the new table with rows for the non-supported majors, too. I think it should work, but it definitely needs some good testing, e.g. on project.d.o or scratch.d.o. As currently written, it's non-destructive (the queries to DROP the old table and column are commented out), so we could run it on any of these sites, see if the new {project_release_supported_versions} table is created and populated correctly, and if not, DROP the new table, fix the DB update, and try again. ;)

Still no more changes to the rest of the code, I was just thinking about the DB upgrade path and the mockups, so those are the main things I've been working on...

dww’s picture

StatusFileSize
new15.63 KB

Finally tested the upgrade code a little, this patch fixes some SQL errors I had, and also improves the code to populate the non-recommended majors into the {project_release_supported_versions} table such that we LEFT JOIN on {project_release_default_versions} to avoid duplicates. This still needs better testing, especially on a copy of the d.o data, but this is a lot closer, and might be all we need.

dww’s picture

StatusFileSize
new5.97 KB

Tried testing the DB upgrade on p.d.o. Found a few problems. New patch that's just against project_release.install...

dww’s picture

StatusFileSize
new15.7 KB

Ok, this one really works. ;) We need to ignore release nodes with NULL as version major (the evil ~1000 HEAD release nodes from the conversion to the current release system). The {project_release_supported_versions} table is now populated correctly on project.drupal.org (not that anyone else can see that or play with it yet). ;) This patch also includes dmitri's initial efforts in project_release.module again...

dww’s picture

StatusFileSize
new17.98 KB

Started working on the code itself again, based on my review in #5:
A) TODO
B) Fixed
C) TODO
D) Fixed
E) Fixed
F) My review was bogus, I see where you're setting it now. However, '#core_name' is wrong. This should be something like 'term_name', or 'api_term_name', as per point (A). I went with 'api_term_name', so we can call this Fixed.

dww’s picture

whoops, that last attachment was the wrong patch. Oh well, it's obsolete now anyway...

New patch that fixes (A) and (C). Furthermore, this implements the form builder, theme function, and submit handler, for the primary form elements: supported, recommended, and snapshot. Also includes the help text. See attached screenie.

TODO:
G) The validation handler.

H) Should the help text continue to live in hook_help() or is it better as a form element so it's more easily altered?

I) Display the 'Currently recommended' version based on the saved settings.

J) JS to update 'Currently recommended' based on current form values.

K) Do we need better visual explanation of the '6.x', '5.x', etc?

L) Do we want some kind of header above the help text, like "Supported versions" as in the mockup? If so, that speaks in favor of deciding (H) in favor of a markup form element, not hook_help().

dww’s picture

Just installed the latest patch on http://project.drupal.org. Obviously, there's still no good validation for the sanity of your choices, and this issue is *not* about the resulting changes to the project release download table (which lives at http://drupal.org/node/176776), so there's not much you'll be able to see, yet, other than the admin UI itself. However, folks can start to play with it there if they wish.

This also made me think of another TODO item:

M) This UI should somehow respect the 'project_release_active_compatibility_tids' setting.

dww’s picture

See http://drupal.org/node/204140 about updating project-release-create-history.php to take advantage of this new data. A volunteer for that would be most welcome.

aclight’s picture

Regarding the help text in the screenshot of #15, I don't like "displayed on the front of the project" because I don't think that's very clear. maybe "displayed on the front page of the project" or "displayed on the main page of the project" would be better. I also don't like the way that "Project release API compatibility" is used, because you're using it in places where you need a noun but it doesn't really "feel" like a noun. I realize that's just the default name of the vocabulary and that is not likely to change (at least not in this issue). But perhaps "For each term in the %vocab_name vocabulary". That's a slightly more technical way of saying it, but I think that also works grammatically whether or not the name of the vocabulary itself is a noun.

BTW, I realize that "compatibility" is a noun, but it still doesn't "feel" like one in this usage.

I would also change the last sentence to read "Otherwise, the most recent official release will be listed."

Regarding H), I would prefer this to be as a form element. I think users of my site will have a difficult time grasping this, since most of my project owners don't even use SVN based projects on my site and this might be a bit over their heads. I'd prefer to be able to point them to a documentation page on my site which explains this very thoroughly from within the help text here.

dww’s picture

FYI: http://drupal.org/node/204140 is now done and installed on p.d.o. Not yet committed to CVS, since I want to wait until this is RTBC, too...

dww’s picture

Another TODO:

N) Cleanse the entire project_release.module of references to {project_release_default_versions}

I'm working on this now...

dww’s picture

Assigned: Unassigned » dww
StatusFileSize
new27.99 KB

Untested, but this should deal with (N) completely.
I guess I'm working on the rest of this now, so assigning to myself...

dww’s picture

StatusFileSize
new27.73 KB

Whoops, that was broken. ;) This is better.

dww’s picture

StatusFileSize
new28.65 KB

Initial stab at the validation handler. Sadly, something is screwy here, and even though the messages show up properly, the form elements themselves aren't getting flagged correctly. :( I'm trying to debug this with chx and eaton in #drupal right now, but I wanted to at least post the work-in-progress patch here in the mean while...

dww’s picture

StatusFileSize
new28.71 KB

This patch incorporates all of aclight's suggestions from #18. The revised help text is moved into a form element (H) along with a header for this section of the form (L).

dww’s picture

StatusFileSize
new29.02 KB

Fixes (M) by honoring the 'project_release_active_compatibility_tids' setting.

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new31.81 KB

Adds support for displaying the currently recommended version in the table (I).

Turns out the validation stuff is all working correctly, it's just that most browsers don't handle the red boxes around the checkboxes and radios. :( UGH!! So, I'm declaring (G) done, as well.

So, all that remains would be:
(J) the jQuery sugar coating to update the current recommended as you change stuff
(K) better visual explanation of each core compatibility term ("5.x", etc)?

These are both minor cosmetic points, so I'm setting this back to needs review. The attached patch here is already installed on http://project.drupal.org and seems to be working nicely given my testing. It even correctly updates what's displayed on the front page of the project nodes based on the current recommended version (it just doesn't display everything that's marked as supported at this point, I'm leaving those changes for http://drupal.org/node/176776).

dww’s picture

Status: Needs review » Needs work

Ugh, one more real problem with the current UI:

O) If you uncheck all the "supported" checkboxes for a given version of core, there's no way to "unselect" the radio entirely, so the validation always fails.

So, I think I need to special case this in the validation and submit handler. If a given api tid has no supported versions, just ignore the other form values and clear everything to 0s...

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new32.51 KB

New patch that solves (O)... I think this is all we need for heavy testing for http://drupal.org/node/197186.

webernet’s picture

I'm guessing that the massive list of all core releases at http://project.drupal.org/download is probably a unintended result of this patch.

dww’s picture

Status: Needs review » Needs work

Indeed. ;) Thanks for mentioning it. I'll have to take a look.

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new33.3 KB

Whoops, I already had that fixed in my local workspace, it's just that the latest patch was missing the (minor) changes to project.module and only included project_release.*. This patch is now installed on p.d.o and working fine. ;) Phew.

dww’s picture

StatusFileSize
new35.65 KB

Slick! starbow was kind enough to email me some JS goodness to automagically update the "currently recommended" based on the current value of the radio. now installed on p.d.o. looking sweet! THANKS! ;)

dww’s picture

I've got a few other ideas for JS goodness for this UI. Basically, it'd be nice if the "recommended" and "show snapshot releases" columns were automatically cleared and disabled whenever the "Supported" checkbox for a row isn't checked. This is enforced via FAPI validation (of course), but it'd be slick if JS made the rules more obvious directly in the UI. See what I mean? Not sure how hard this would be, but it seems like it should be pretty easy for the JS-enabled among us. ;)

dww’s picture

Status: Needs review » Needs work

Actually, the DB upgrade could use a little work. It generates some invalid states where the "snapshot" columns are checked for major versions that aren't supported...

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new35.58 KB

That was easy. ;)

junyor’s picture

Subscribing.

starbow’s picture

StatusFileSize
new36.64 KB

This patch includes the Derek's jQuery ideas from #33 (probably needs windows line-feeds stripped out).

dww’s picture

StatusFileSize
new36.7 KB

WOOT! ;) /me hugs starbow again. ;) Here's the patch with the line-feeds cleaned up. Now installed on p.d.o. This is looking amazing.

dww’s picture

Status: Needs review » Needs work

Ugh, whoops. Now the auto-updating of "Currently recommended" is broken:

http://project.drupal.org/node/29351/edit/releases

It's always telling me about 5.x-2.2, even if I try to make 5.x-1.* recommended (unless I actually save the form with 1 selected, on the reload, it correctly tells me that 5.x-1.0 is currently recommended).

Also, if the supported checkbox *starts* as unselected on page load (due to saved settings), we should disable the recommended radio and snapshot checkbox for that row, too...

starbow’s picture

StatusFileSize
new36.79 KB

Give this one a try.

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new37.15 KB

Much better, thanks! I made a few more changes myself:

- fixed typo in one of the validation messages.

- more verbose validation messages that at least include which version of core the message relates to. since most browsers fail to display the nice red boxes around the error checkbox or radio elements the form_set_error() is marking, at least the text can help point people to the right place to fix the error.

- in local testing, i found that i needed to add this to function _project_release_get_current_recommended_version():

drupal_set_header('Content-type: text/javascript');

otherwise, with devel.module enabled, you get the huge query log table junk printed at the bottom. i know this isn't technically javascript itself, it's just a plain string. so, the alternative would be this:

$GLOBALS['devel_shutdown'] = FALSE;

i'm not sure which is better. the header is more generally useful, but not exactly true. the devel_shutdown global solves this particular problem, but is more special-case. @starbow: any opinions on this?

dww’s picture

Status: Needs review » Needs work

Installed #41 on p.d.o, and it's looking very good -- nearly perfect. However, I noticed 1 lingering problem with how the currently recommended stuff is handled when you uncheck a supported checkbox. e.g. start here:

http://project.drupal.org/node/29351/edit/releases

- for 5.x, 1 is supported and recommended, and currently recommended == 5.x-1.0
- if you uncheck "supported", the whole row is cleared out and disabled, but currently recommended stays as 5.x-1.0
- then, if you click "update", it tells you "You can not recommend a major version that is not supported for 5.x.", and you see that the recommended radio is actually still selected for 5.x-1.*. it's as if the ".removeAttr('checked');" in the JS doesn't fully work to clear the radio -- it just visually clears it but under the covers, it really still behaves as if it was selected as 5.x-1.*. :(

I tried this on both Safari 3 and FF 2.0.0.11 and it's broken the same way for both browsers, so I'm pretty sure this isn't just Safari being stupid.

Instead of just using ".removeAttr('checked');", would it be possible to explicitly set the value of the recommended radio to "-1" or something?

starbow’s picture

Hmm, two issues here:
line 31 in project_release.js should be: $(this).parents('table:eq(0)').find(".recommended").each( function(i) { if(this.checked) { recommended = true; } });
That should fix the recommended not changing.
Not sure about the update issue. I was able to reproduce this once, but then every other time I tried it, it worked as I expected it to. Any help reliably reproducing it would be cool.

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new37.18 KB

Cool, I think that does it. Attached patch is now installed on p.d.o, and it's working reliably for me, too. Woo hoo! Thanks!!

dww’s picture

Status: Needs review » Needs work
StatusFileSize
new165 KB
new87.15 KB
new87.91 KB

Sorry, spoke too soon. ;) It's still a little wonky in the case where you save it. The scenario I describe above seems to consistently fail on both safari and FF. I'll try again to spell it out:

A) Start with 5.x, both 2 and 1 are supported, and 1 is recommended. (project_203313_js_A_initial.png)

B) Uncheck "Supported" for version 1. (project_203313_js_B_unsupported-1.png)

C) Click "Update" and you get a validation error: "You can not recommend a major version that is not supported for 5.x." (project_203313_js_C_update.png) Note here that "Recommended" radio is selected for major version 1, but disabled since the "Supported" checkbox isn't checked.

Are you not seeing this?

Thanks for all the help in here. This is going to totally kick ass when it's done and deployed on d.o. ;)

moshe weitzman’s picture

fyi, devel will be quiet if you have a Content-Type of text/plain as well.

webernet’s picture

I can consistently reproduce #45 on Firefox 2.

If you uncheck 'Supported' on the currently recommended branch, and there is another supported branch for the same core version, then the recommended radio should be moved to the next available branch (not just deselected). If there is no other supported branch for that core version, then it should select a major version 'None' row (preferably only available if there is no supported branch), since there should always be a radio selected.

starbow’s picture

StatusFileSize
new39.45 KB

Boy, this stuff gets complicated fast.

1) Here is pretty serious rewrite of the project_release.js. It makes sure there is a recommended version radio selected, as long as there is at least one supported version. It needs thorough testing.

2) I am happier with Content-Type = text/plain

3) We could speed up displaying the recommended version string by caching it in the table row with display='none' when the table is initially generated in theme_project_release_project_edit_form. That would remove the need for the ajax call, which can be pretty slow. This could be as simple as multiple calls to project_release_get_current_recommended in the foreach ($api_data['majors']... loop in _project_release_edit_version_major_form, but I suspect there is a smarter way. I will let you chew that one over.

dww’s picture

StatusFileSize
new38.61 KB

@starbow, thanks for continuing to work on this complicated mess. ;) I was out of town all weekend, and just now am getting back to this issue. I rerolled your latest patch to strip line endings, fix it for 'Content-Type = text/plain', and remove the bogus // $Name: BASE $ changes. now installed on p.d.o and looking great to my testing. my previous failure case is now handled splendidly. ;)

However, I'm going to leave this CNW, since I agree, we should probably just rip out the AJAX entirely, and have the form builder just populate the form with the recommended version from each branch in a hidden column. then, the js can just twiddle things to display the right one based on the recommended radio.

should I just work on a new patch to everything else and upload it here, then leave the project_release.js changes for you? would that be the easiest approach? yes, i think multiple calls to project_release_get_current_recommended() is fine. any attempt to get that info correctly in a single query is just going to make a vastly more complicated and expensive query. plus, i can't see how N queries like that for the form builder for this relatively obscure maintainer UI is going to be a problem, particularly if it saves doing another query to handle the AJAX request on nearly every click on the UI. ;)

dww’s picture

StatusFileSize
new37.9 KB

Something like this for the FAPI code, I guess. I ripped out the AJAX menu handler, too. This just needs changes to project_release.js to populate the visible "Currently recommended:" field using the 5th column (of hidden form elements) in the table. Not sure if this is best, but I figured I'd get it started down this route. Please let me know if there's a better way to do this. Thanks!

starbow’s picture

Status: Needs work » Needs review
StatusFileSize
new39.45 KB

Yeah, the non-ajax route isn't as sexy, but it is simpler and faster, so I guess I'll just have to suck it up. I tweaked the theming a little bit (the hidden field shouldn't be in its own col), and modified the .js file. Still needs live testing (for testing on my site I have to make an educated guess exactly what the FAPI generated html will look like), but we might be good to go.

dww’s picture

Status: Needs review » Needs work

@starbow: I'm confused by your latest patch... it seems to be identical to your last one from #48, and therefore undoes whatever goodness I added in #50. Did you just upload the wrong thing? Thanks.

Btw, yeah, I agree the hidden column shouldn't be a real table column, I just wasn't sure the cleanest, easiest way to handle that, so it was a start. I'm anxious to see what you cooked up that's better... I'm always learning about all this JS mojo and finding better ways to deal with things. ;)

Cheers,
-Derek

starbow’s picture

Status: Needs work » Needs review
StatusFileSize
new38.32 KB

Whoopsie. That is the patch from #48. Try this one.

dww’s picture

Status: Needs review » Needs work

Cool, almost there. I spotted 2 bugs in initial testing:

A) The "Currently recommended" field isn't filled in initially due to a name mismatch in the form array.
B) The "Currently recommended" value isn't set to the yellow background when you change it, unless you completely unset it.

I can definitely fix (A), and I think I see how to fix (B), so I'll take a quick stab at re-rolling this. ;) Stay tuned.

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new37.58 KB

New patch with the following:

- Correctly populates the initial value for $current_recommended by looking for 'version_name' in the $form array (what it's now called), not 'current_recommended'.

- Correctly handles the case where the initial value should be 'n/a' when there's no supported or recommended versions for a given version of core. My previous db_query() here was assuming a valid result, but we need to handle a db_result of 'false', too.

- project_release.js both updates the version string and sets the yellow background when you toggle the recommended version. starbow, if you could verify I did that the elegant jQuery way, that'd be swell, but I think I did it right. ;)

Now installed on p.d.o. Seems to work great in my testing. ;) PHEW!!! ;)

The *only* other UI improvement I could see here is setting yellow backgrounds for *any* unsaved changes, not just the recommended version (e.g. the snapshot or supported checkboxes, too), but I don't know if that's worth the hassle.

I think this is dangerously close to RTBC now. Any other reviews or tests would be welcome. Thanks!

starbow’s picture

Status: Needs review » Reviewed & tested by the community

I think we are good.
I don't think adding more yellow is that useful. Having it highlight the changed version is enough to let you know there are unsaved changes, adding more yellow is just redundant.
Your jQuery is spiffy indeed.

dww’s picture

Status: Reviewed & tested by the community » Needs work

Drat. :( The jQuery part of the UI is RTBC, but under heavy testing of the kinds of edge cases we've been seeing at http://drupal.org/node/126554, the underlying code, especially project_release_check_supported_versions(), is wrong. :( I'm working on a patch now, stay tuned...

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new40.12 KB

Like so. Massive re-write of project_release_check_supported_versions(). This also incorporates the input from http://drupal.org/node/126554#comment-696383. I tested this *A LOT* locally, all kinds of edge cases. I couldn't seem to break it. Now on p.d.o, if people want to try to break it themselves.

dww’s picture

StatusFileSize
new40.14 KB

Fixed 1 more minor UI bug. When we were selecting the API terms to generate our form, we weren't specifying an order. Now we ORDER BY term_data.weight, term_data.name, and everything works as expected. Installed on p.d.o...

dww’s picture

StatusFileSize
new41.51 KB

Even better. Instead of calling taxonomy_node_save() ourselves in the case where that mattered (a new release node is created directly as a published node), we can handle everything elegantly and in one place by implementing hook_nodeapi for 'project_release' nodes. Since project_release has to be weighted heavier than taxonomy for other things to work, anyway, we know this nodeapi hook will fire after taxonomy's. Therefore, on new published release nodes, the term associations will already be in the DB when we hit project_release_check_supported_versions(). This actually simplifies some other code, too, since we don't have to handle this checking code (and cache clearing) separately in hook_update(), hook_insert(), and hook_delete(). Yay.

dww’s picture

Now deployed on p.d.o. This definitely solves all the edge cases reported at http://drupal.org/node/126554 under my testing. I think this is now totally RTBC. The only reason to wait is that it'd be nice to see progress in http://drupal.org/node/176776, since I'd like to deploy both at the same time. However, I wouldn't even mind a brief transition period where only the recommended version from this maintainer UI is presented on the project node, and the 'snapshot' checkbox doesn't really do anything (which is how it works now). That said, any more testing or reviews would be most welcome. Thanks.

cwgordon7’s picture

Looks good, applies cleanly, and works well; previously mentioned edge cases do not seem to be applicable. If this could be committed to HEAD before I start rolling patches for 176776, it would make creating clean patches for that issue much easier; a small amount of time alone in HEAD won't do any harm, and Drupal.org doesn't have to switch to it right away just because it's in HEAD.

dww’s picture

Status: Needs review » Fixed

Committed to HEAD. Yay! I'll mark #126554# fixed once this is deployed on d.o. Thanks again to everyone who helped!

dww’s picture

Whoops, there was a lingering spot in project_release_project_nodeapi() where we were trying to populate {project_release_projects} with the now bogus "snapshot_table" column. Now fixed in HEAD: http://drupal.org/cvs?commit=96837

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

vvs’s picture

Priority: Critical » Normal
Status: Closed (fixed) » Active

How I added Development snapshot to project without CVS? I'm manually added relises into project.
That I see here: http://drupal.org/project/gallery. How to make this?

michelle’s picture

Status: Active » Fixed

@VVS: You can't add code to someone else's project with or without a CVS account. If you have code to offer, file an issue and attach a patch. Also, please start new issues for new questions rather than re-opening closed ones.

Michelle

dww’s picture

Status: Fixed » Closed (fixed)