Problem/Motivation
I read in the code that basefields are if-checked and opted out of field_types that are to be copied under BulkCopyFieldsForm.php. I then googled it to possibly find out about the downsides to get data from a basefield but couldn't find anything.
I needed so desparately to copy the Placed date (base) field of commerce_order entity type to another date field that is user-defined in the interface. I deleted those if-checks and could get a list of basefields in the Copy From step. On the next step I got the following error:
Notice: Undefined index: placed in Drupal\bulk_copy_fields\Form\BulkCopyFieldsForm->buildForm() (line 236 of modules/contrib/bulk_copy_fields/src/Form/BulkCopyFieldsForm.php).
I think this means that it is not opting out the source field at some point while building the option list for the target fields. It may be the same issue with #3033221: Error when trying to copy date field
In the target list there was only completed field, which is also a base date field. My user-defined date field wasn't listed. I wasn't able to find the code where the target list is built. Do you think I should force in this direction? If yes, can you give a hint?
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3178990-3.patch | 5.73 KB | el1_1el |
Comments
Comment #2
el1_1el commentedI have some time at the moment and am working on this. The issue is dates can be returned as datetime, date or daterange. created and revised are timestamps so they have to all be converted correctly for it to work. will post a patch and/or a commit to dev when ready.
Comment #3
el1_1el commentedThis should do it. I'll commit to dev branch also. Open back up if you have issues.
Comment #5
el1_1el commented