-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom field form reform #18419
Custom field form reform #18419
Conversation
(Standard links)
|
c707b92
to
1527463
Compare
test this please |
@highfalutin you've created a monster... |
@eileenmcnaughton sorry? 😂 |
test this please |
I know @eileenmcnaughton this is a big diff. (would be smaller but it includes #18356). It's not the sort of thing to review line-by-line as it's overhauling a quickform with a lot of messy code. It just needs to be run. |
I'm hoping @highfalutin will do UI testing as penance for opening this Pandora's box... |
1527463
to
b3134db
Compare
Just noting that I agree ui testing is what is required to get this merged. I don't have concerns about the code or test cover & the impact can be judged by testing the form used to manage custom fields & in particular changing between field types |
@colemanw Just to be sure before I wade into testing - we do expect data loss on item 1 when converting, am I correct? I am uneasy about that to be frank. Do we have a gitlab discussion on this? |
@kcristiano This PR is mostly just a UI change. You may want to familiarize yourself with the previous UI, in which it was also possible to change a Multi-Select to a Single-Select (by clicking on "Change input field type" while editing a custom field). Yes, doing so would cause data-loss, and still does. However I think you'll find the new UI in this PR does a better job of warning you about just how much data will be lost before allowing you to proceed. |
Thanks @colemanw That makes sense, I'll give this a test. |
@colemanw 1 and 3 work exactly as expected.
I created a text input field and I cannot change the field type at all. Am I doing something wrong, perhpas a screen shot of what is expected here would help. |
@kcristiano I don't think it was possible to change text field type prior to this PR, so if you're trying to do a "before" comparison then it won't work. This PR makes it possible and also adds validation to make it safe. |
--deleted-- problem with local test environment. |
@colemanw Never mind. The screens now show up properly - not sure what happened before, but a restart of my local dev has it appearing now: r-run shows this to work as expected. Would love more UI review, but it looks good to me. |
@@ -280,7 +280,7 @@ public static function getClasses() { | |||
* Get the classname for the table. | |||
* | |||
* @param string $tableName | |||
* @return string | |||
* @return CRM_Core_DAO|NULL | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return is a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For convenience of IDE auto-completion, we kinda hack the @return
annotationwhen it's returning a string which is also a class name. In php strings can be used interchangeably with classes, go figure.
@colemanw please self-merge this once you have addressed @demeritcowboy's comments - @kcristiano seems mostly adequate (bar missing the date_type - but we got that spotted now :-)) |
Adds or removes CRM_Core_DAO::VALUE_SEPARATOR from custom values when switching a field from single to muti-valued.
This overhauls the custom field administration form: - Gets rid of the difficult-to-use hierarchcal select - Removes changeFieldType as a separate form - Allows changing field type on the main form, with improved validation - Fixes up some metadata - Improves choosing default values
b3134db
to
9b85cd3
Compare
Overview
This overhauls the admin form for creating/updating custom fields, with improved validation, easier-to-select defaults, and more flexibility about changing the widget type.
Before
After
Comments
This PR will need some manual testing. Some workflows to test: