Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #115 from cultuurnet/bugfix/fix-missing-calendar-s…
Browse files Browse the repository at this point in the history
…tart-and-end-date

Update cultuurnet/udb3 dependency to make start and end date optional
  • Loading branch information
bertramakers committed Sep 10, 2020
2 parents 803af36 + 9a6cc10 commit 9776378
Show file tree
Hide file tree
Showing 78 changed files with 184 additions and 167 deletions.
29 changes: 18 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/ReadModel/OfferToCdbXmlProjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,14 @@ public function applyTypicalAgeRangeUpdated(
$event->setAgeTo((int) $ageToString);
}

// Workaround for backwards compatibility:
// Since III-3399 the age "from" is always 0 if no from is given.
// But to maintain compatibility with previous behaviour, we don't set it on the cdbxml
// if there's no "to" either.
if ($event->getAgeFrom() === 0 && $event->getAgeTo() === null) {
$event->setAgeFrom();
}

// Change the lastupdated attribute.
$event = $this->metadataCdbItemEnricher
->enrich($event, $metadata);
Expand Down
4 changes: 2 additions & 2 deletions tests/CdbXmlDocument/samples/event.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
4 changes: 2 additions & 2 deletions tests/ReadModel/AbstractCdbXmlProjectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ public function entityDataProvider()
{
$timestamps = [
new Timestamp(
\DateTime::createFromFormat(\DateTime::ATOM, '2014-01-31T12:00:00+01:00'),
\DateTime::createFromFormat(\DateTime::ATOM, '2014-01-31T13:00:00+01:00'),
\DateTime::createFromFormat(\DateTime::ATOM, '2014-01-31T15:00:00+01:00')
),
new Timestamp(
\DateTime::createFromFormat(\DateTime::ATOM, '2014-02-20T12:00:00+01:00'),
\DateTime::createFromFormat(\DateTime::ATOM, '2014-02-20T15:00:00+01:00')
\DateTime::createFromFormat(\DateTime::ATOM, '2014-02-20T16:00:00+01:00')
),
];

Expand Down
4 changes: 2 additions & 2 deletions tests/ReadModel/OfferToCdbXmlProjectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2739,12 +2739,12 @@ private function getTimestamps()
{
return [
new Timestamp(
\DateTime::createFromFormat(\DateTime::ATOM, '2014-01-31T12:00:00+01:00'),
\DateTime::createFromFormat(\DateTime::ATOM, '2014-01-31T13:00:00+01:00'),
\DateTime::createFromFormat(\DateTime::ATOM, '2014-01-31T15:00:00+01:00')
),
new Timestamp(
\DateTime::createFromFormat(\DateTime::ATOM, '2014-02-20T12:00:00+01:00'),
\DateTime::createFromFormat(\DateTime::ATOM, '2014-02-20T15:00:00+01:00')
\DateTime::createFromFormat(\DateTime::ATOM, '2014-02-20T16:00:00+01:00')
),
];
}
Expand Down
4 changes: 2 additions & 2 deletions tests/ReadModel/RelationsToCdbXmlProjectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,12 @@ public function createEvent($eventId, $theme = true, $contactPoint = false)
{
$timestamps = [
new Timestamp(
\DateTime::createFromFormat(\DateTime::ATOM, '2014-01-31T12:00:00+01:00'),
\DateTime::createFromFormat(\DateTime::ATOM, '2014-01-31T13:00:00+01:00'),
\DateTime::createFromFormat(\DateTime::ATOM, '2014-01-31T15:00:00+01:00')
),
new Timestamp(
\DateTime::createFromFormat(\DateTime::ATOM, '2014-02-20T12:00:00+01:00'),
\DateTime::createFromFormat(\DateTime::ATOM, '2014-02-20T15:00:00+01:00')
\DateTime::createFromFormat(\DateTime::ATOM, '2014-02-20T16:00:00+01:00')
),
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
4 changes: 2 additions & 2 deletions tests/ReadModel/Repository/samples/event-copied-original.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
4 changes: 2 additions & 2 deletions tests/ReadModel/Repository/samples/event-deleted.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
4 changes: 2 additions & 2 deletions tests/ReadModel/Repository/samples/event-imported.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<cdb:timestamps>
<cdb:timestamp>
<cdb:date>2014-01-31</cdb:date>
<cdb:timestart>12:00:00</cdb:timestart>
<cdb:timestart>13:00:00</cdb:timestart>
<cdb:timeend>15:00:00</cdb:timeend>
</cdb:timestamp>
<cdb:timestamp>
<cdb:date>2014-02-20</cdb:date>
<cdb:timestart>12:00:00</cdb:timestart>
<cdb:timeend>15:00:00</cdb:timeend>
<cdb:timeend>16:00:00</cdb:timeend>
</cdb:timestamp>
</cdb:timestamps>
</cdb:calendar>
Expand Down
4 changes: 2 additions & 2 deletions tests/ReadModel/Repository/samples/event-namespaced.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<cdb:timestamps>
<cdb:timestamp>
<cdb:date>2014-01-31</cdb:date>
<cdb:timestart>12:00:00</cdb:timestart>
<cdb:timestart>13:00:00</cdb:timestart>
<cdb:timeend>15:00:00</cdb:timeend>
</cdb:timestamp>
<cdb:timestamp>
<cdb:date>2014-02-20</cdb:date>
<cdb:timestart>12:00:00</cdb:timestart>
<cdb:timeend>15:00:00</cdb:timeend>
<cdb:timeend>16:00:00</cdb:timeend>
</cdb:timestamp>
</cdb:timestamps>
</cdb:calendar>
Expand Down
4 changes: 2 additions & 2 deletions tests/ReadModel/Repository/samples/event-private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<timestamps>
<timestamp>
<date>2014-01-31</date>
<timestart>12:00:00</timestart>
<timestart>13:00:00</timestart>
<timeend>15:00:00</timeend>
</timestamp>
<timestamp>
<date>2014-02-20</date>
<timestart>12:00:00</timestart>
<timeend>15:00:00</timeend>
<timeend>16:00:00</timeend>
</timestamp>
</timestamps>
</calendar>
Expand Down

0 comments on commit 9776378

Please sign in to comment.