I'd like to be able to map a GC field (probably text field) to a Drupal Date field.

I would love to write a patch.
Will maintainers consider this feature?

Comments

aaronbauman created an issue. See original summary.

mirom’s picture

Hi aaronbauman, we are happy to review any patch from you.

aaronbauman’s picture

Status: Active » Needs review
StatusFileSize
new3.48 KB

In this patch:
- new function gc_gc_process_default_field() for handling GC fields (default case.)
- additional logic for date and datetime fields

aaronbauman’s picture

StatusFileSize
new3.46 KB

oops, left a debugging line.

mirom’s picture

Status: Needs review » Needs work

Hi, it seems that you left out translations.

aaronbauman’s picture

Status: Needs work » Needs review

Translation is identified and initialized first thing in the new helper function:

+function gc_gc_process_default_field(NodeInterface &$entity, $local_field_name, $is_translatable, $language, $field) {
+
+  $value = $field->value;
+  $target = &$entity;
+  if ($is_translatable) {
+    $target = $entity->getTranslation($language);
+  }

It's a different, more DRY approach than elsewhere in the module.

mirom’s picture

Sorry, I didn't realise it. Looks fine for me, I will do some testing today.

  • aaronbauman authored 149f2b0 on 8.x-3.x
    Issue #2824073 by aaronbauman: Support for importing to Date field type
    
mirom’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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