As part of #2137201: [META] Regressions in project_release handling of version element fields and release-history XML we need to ensure that versioncontrol_release is altering the release node form to hide the version element fields but set their values to the right things based on invoking the label_version_mapper plugin to get the version components from a given Git tag.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Assigned: Unassigned » dww
dww’s picture

Status: Active » Needs review
FileSize
2.7 KB

This turned into a bit of a mess. :/ Since the form elements for the version subfields are generally configured to use the 'hidden' widget, I couldn't figure out how to set the values directly via altering the form. Instead, the current patch in #2145667: project_release_node_presave() should only parse the version string if the version elements are not already set uses an array for the flag where we tell project_release to preserve these subfields, and it walks over that array and directly sets the values during project_release_node_presave(). Not super clean, but working via local testing. If someone has a better idea, I'm happy to code it up, but since this is now working, I don't think it's wise to spend a bunch more time on this.

dww’s picture

FileSize
2.84 KB

Whoops, realized I had uploaded the wrong version of the patch. The one from #2 wasn't correctly handling the case when you edit an existing release node. This one should work for that, too.

dww’s picture

FileSize
2.93 KB

Via more testing on http://dww7-drupal.redesign.devdrupal.org I realized I had a few trivial typos that was preventing this from working as expected on a real d.o clone. New patch is working nicely for adding and editing both core and contrib releases, with and without 'extra'. I think this is ready to go, unless someone has a better idea on how to propagate these values to project_release directly via the field form elements.

drumm’s picture

Status: Needs review » Reviewed & tested by the community

Looks good on reading code.

dww’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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