Skip to content

Commit

Permalink
Additional Pipeline fix (NOJIRA)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Sep 1, 2024
1 parent 2573f9c commit d541e2d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions app/src/Model/Table/PipelinesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,24 @@ protected function duplicateFilterEntityData($entity): array {
$newdata['status']
);

// Get the list of "visible" fields -- this should correlate with the
// set of fields defined on the entity, whether or not they are populated,
// including metadata fields.

$visible = $entity->getVisible();

// Timestamps are FrozenTime objects in the entity data, and is_scalar
// will filter them out, so convert them to strings

foreach(['valid_from', 'valid_through'] as $attr) {
if(!empty($entity->$attr)) {
$newdata[$attr] = $entity->$attr->i18nFormat('yyyy-MM-dd HH:mm:ss');
} elseif(isset($entity->$attr)) {
// Populate a blank value so removal works correctly (but don't inject
// the fields to models that don't have them)
$newdata[$attr] = "";
if(in_array($attr, $visible)) {
if(!empty($entity->$attr)) {
$newdata[$attr] = $entity->$attr->i18nFormat('yyyy-MM-dd HH:mm:ss');
} else {
// Populate a blank value so removal works correctly (but don't inject
// the fields to models that don't have them)
$newdata[$attr] = "";
}
}
}

Expand Down

0 comments on commit d541e2d

Please sign in to comment.