Closed (works as designed)
Project:
Cloud
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Reporter:
Created:
11 Jan 2019 at 08:02 UTC
Updated:
11 Jan 2019 at 22:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
xiaohua guan commentedComment #3
xiaohua guan commented@yas
Please review the patch. Thanks.
Because there is no entity type VPC, I can't add a link to vpc_id.
Comment #4
yas@xiaohua-guan,
Could you please add the fieldset in the edit view as the same manner as the detailed view?
In detailed view,
In edit view,
Comment #5
xiaohua guan commentedComment #6
xiaohua guan commentedComment #7
xiaohua guan commented@yas
Please review the new patch. Thanks.
Comment #8
xiaohua guan commentedComment #9
yas@xiaohua-guan
I tested it, looks so nice. I'll merge the patch and mark this issue as
Fixed.Comment #11
yasComment #12
baldwinlouie commentedChanging from #type=>textfield to #type=>item causes problem during the saving of the entity.
Form elements that are #type item are not saved back into the database. #type=>item is a display only form element.
So in the case of cloud_context, vpc_id, group_name, when saving them as #type=>item, Drupal will not be able to find those values, and save a NULL value into the database.
I found this behavior when working in issue https://www.drupal.org/project/cloud/issues/3023993. What ends up happening is that on a subsequent edit of the security group, all the plugins and api code will error out because cloud_context becomes NULL.
Steps to reproduce
1. Import security nodes
2. Edit one of them
3. Check the database. The cloud_context field will be null.
I think an alternative would to be make change the #type=>item fields to #type=>value. This will ensure Drupal has access to it. Then make a copy of the #type=>value into a new #type=>item for form display.
Comment #13
baldwinlouie commentedPlease ignore my comment in #12. I found this function, copyFormItemValues(), which fixed the issue described above.