Publish 2.4.4

Some small fixes after 2.4.3
parent e80c7dd3
parameters:
app.version: 2.4.3
\ No newline at end of file
app.version: 2.4.4
\ No newline at end of file
......@@ -96,7 +96,9 @@ class MigrationCommand extends GoGoAbstractCommand
if (count($this->messages) > $migrationState->getMessagesIndex()) {
$messagesToAdd = array_slice($this->messages, $migrationState->getMessagesIndex());
$this->log(count($messagesToAdd) . " messages to add");
foreach($dbs as $db) {
$this->log("add message on project " . $db);
foreach($messagesToAdd as $message) {
// create a GoGoLogUpdate
$asyncService->callCommand('gogolog:add:message', ['"' . $message . '"'], $db);
......
......@@ -51,16 +51,19 @@ class OpenHours
* @MongoDB\EmbedOne(targetDocument="Biopen\GeoDirectoryBundle\Document\DailyTimeSlot") */
private $Sunday;
public function __construct($openHours)
public function __construct($openHours = null)
{
foreach ($openHours as $day => $timeSlotString) {
$slot1start = null; $slot1end = null; $slot2start = null; $slot2end = null;
$slots = explode(',', $timeSlotString);
if (count($slots) > 0) list($slot1start, $slot1end) = $this->buildSlotsFrom($slots[0]);
if (count($slots) == 2) list($slot2start, $slot2end) = $this->buildSlotsFrom($slots[1]);
$dailySlot = new DailyTimeSlot($slot1start, $slot1end, $slot2start, $slot2end);
$method = 'set' . $this->days[$day];
$this->$method($dailySlot);
if ($openHours && is_array($openHours))
{
foreach ($openHours as $day => $timeSlotString) {
$slot1start = null; $slot1end = null; $slot2start = null; $slot2end = null;
$slots = explode(',', $timeSlotString);
if (count($slots) > 0) list($slot1start, $slot1end) = $this->buildSlotsFrom($slots[0]);
if (count($slots) == 2) list($slot2start, $slot2end) = $this->buildSlotsFrom($slots[1]);
$dailySlot = new DailyTimeSlot($slot1start, $slot1end, $slot2start, $slot2end);
$method = 'set' . $this->days[$day];
$this->$method($dailySlot);
}
}
}
......
......@@ -95,6 +95,8 @@ class ElementImportMappingService
// Ontology
$this->collectOntology($data, $import);
$data = $this->mapOntology($data);
if (!is_array($data)) return [];
// remove empty row, i.e. without name
$data = array_filter($data, function($row) { return array_key_exists('name', $row); });
......
......@@ -52,6 +52,13 @@ class ElementImportOneService
{
$updateExisting = false; // if we create a new element or update an existing one
$realUpdate = false; // if we are sure that the external has been edited with 'FieldToCheckElementHaveBeenUpdated'
// adds missings fields instead of checking if each field is set before accessing
$missingFields = array_diff($this->coreFields, array_keys($row));
foreach ($missingFields as $missingField) {
$row[$missingField] = "";
}
if (isset($row['id']))
{
if (in_array($row['id'], $import->getIdsToIgnore())) return;
......@@ -92,12 +99,6 @@ class ElementImportOneService
}
$this->currentRow = $row;
// adds missings fields instead of checking if each field is set before accessing
$missingFields = array_diff($this->coreFields, array_keys($row));
foreach ($missingFields as $missingField) {
$row[$missingField] = "";
}
$element->setOldId($row['id']);
$element->setName($row['name']);
$address = new PostalAddress($row['streetAddress'], $row['addressLocality'], $row['postalCode'], $row["addressCountry"]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment