Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2145675-4.vcrelease-set-version-subelements.patch | 2.93 KB | dww |
Comments
Comment #1
dwwI've got some time on a train today, so I'll try to get this (and #2145667: project_release_node_presave() should only parse the version string if the version elements are not already set) working.
Comment #2
dwwThis 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.Comment #3
dwwWhoops, 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.
Comment #4
dwwVia 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.
Comment #5
drummLooks good on reading code.
Comment #6
dwwPushed http://drupalcode.org/project/versioncontrol_project.git/commit/943ea58 and deployed live.
Thanks!
-Derek