Commit graph

118 commits

Author SHA1 Message Date
3b4ecbe6ce Extend demand and provide search to templates 2022-07-13 15:59:40 +02:00
6e6e914e36 Ensure first date of recurring daily event is created 2022-07-13 13:58:05 +00:00
b0dae68550 Fix broken timezone and end time after import of recurring events 2022-07-07 12:10:49 +00:00
6b6ae5b20c Do not break tests once a certain date is passed
The code used native date functions, this made tests not robust.
We switch to TYPO3 API to fetch the current date and time.
Test is adjusted to define the date and time to verify code works as
expected.
2022-07-07 09:10:14 +02:00
3d98475a6c Fix none working import of ticket links from destination data
The existing code didn't work with the provided data.
We added a new test case to cover the situation.
We adjusted the existing code to check on the actual rel value instead
of the keys.
2022-07-07 09:03:29 +02:00
96f07fd501 Ensure title of sys_file_metadata is not exceeded
The columns is limited by length.
We ensure we do crop incoming file names before adding them to the
database.
We would run into exception otherwise.
2022-06-28 11:39:12 +02:00
fc8c2b3046 Do not enter endless loop while date creation
Entering the continue part would end in an endless loop.
We never add anything to $i and therefore would end up here.

Existing tests ensure we don't break something.
The new test ensures we do not hit endless loop anymore.
2022-06-27 16:07:36 +02:00
58d602c153 Allow to define midnight or now for todays dates 2022-05-16 13:30:18 +02:00
c506720689 Respect that interval is now always set within timeIntervals
The property will always be set in the future.
We no longer can use it as an indicator.

We switch to freq as new indicator.
We also ensure that start has to be given for a single date.

Relates: #9892
2022-04-25 07:47:47 +02:00
4ef67b9bae Refactor date creation during import
Split into own class to encapsulate the logic.
2022-04-21 09:30:23 +02:00
3d6bf0ac8a Add import configuration record
It is now possible to create "Import" records in TYPO3 system.
Those records can then be imported via two new commands.
There is no need to configure everything within the command itself.

That allows:
    * To allow editors to maintain import configuration.
    * Have proper labels, description, csh and UI to create import.
      It no longer is necessary to copy UIDs,
      instead proper wizards from TCA are available to select pages.

Relates: #9649
2022-01-27 15:50:36 +01:00
4bc4f34525 Add support for search query in DO import command
Relates: #9648
2022-01-27 07:57:05 +01:00
b5d095659a Use new import class and move url building and fetching 2022-01-26 15:15:15 +01:00
c6ca707b1c Fix warnings in higher PHP versions ending up in TYPO3 log 2021-12-20 10:20:47 +01:00
06d111e132 Do not trigger warning if no category was configured
The import already worked without category, but triggered a warning.
Tests were extended to always work with category, except in new test
case.
All tests were extended to check for empty logs in the end.

The import now checks whether category should be imported and ignores
further processing if not configured.

Relates: #9542
2021-12-20 10:15:26 +01:00
eecbb1feb4 Remove useless file
This got introduced somewhere during refactoring but was left empty
anyway.
2021-12-20 10:15:09 +01:00
ab9c3e0c4e Fix broken remove past data
Past data is now removed again.
A test ensures the functionality.
Data is no longer marked as deleted but is actually deleted.

Relates: #9543
2021-12-20 09:45:25 +01:00
a8c475fbd7 Reflect TYPO3 behaviour in tests
TYPO3 scheduler tasks always have a value for console commands.
Region uid will be an empty string if omitted within scheduler task.
We reflect that in our tests and adapt code to not break.
Furthermore tests call only with strings, as that's what TYPO3 does.
2021-12-16 14:34:17 +01:00
6aa4681cb9 Delete files which were referenced by events objects
Adjust existing code base to not use hardcoded file path.
Instead use info from database and check all files which have references
to event objects.

Also add test to cover feature.
2021-12-16 14:07:32 +01:00
15dec49445 Remove usage of uploads folder, use transient API instead
Relates: #9533
2021-12-16 10:00:51 +01:00
de82e395e6 Fix Coding Guideline check on CI
The current setup actually fixed and didn't check or fail.
That's changed and code is fixed.
2021-12-16 09:13:15 +01:00
0e5cd38176 Add first basic functional test for import
The test ensures import runs with a small example set of events.

We needed to alter fetching of images, in order to properly mock
responses.
2021-12-16 09:08:16 +01:00
73161fa24e Make region optional during import 2021-12-14 17:31:56 +01:00
29c31375a5 Remove PHPStan issues
Most were fixed, some were ignored on top level.
2021-12-14 17:31:46 +01:00
a576709947 Use dependency injection within command
Do not fetch service with legacy API, instead use proper Dependency
Injection.

Relates: #9532
2021-12-14 16:09:42 +01:00
0d0c64f419 Fix PHPStan issues 2021-12-13 09:27:28 +01:00
b430993655 Remove execution rights from php file 2021-12-13 08:51:32 +01:00
ce3863619e Add query callback to date demand
This allows 3rd party to alter the query of dates when demand is used.
E.g. allow more complex filters specific for some situations like CEs.

Relates: #9505
2021-12-07 15:26:25 +01:00
30f030aab6 !!!|Show all coming + running dates by default
Only coming dates were shown by default.

Relates: #9505
2021-12-06 12:34:32 +01:00
bc6aa4d359 Apply stdWrap to date demand settings
Move to a dedicated factory for easier re use.
Add dependencies and apply stdWrap to properties.
That allows to dynamically set values like dates by using stdWrap
features.

E.g.:

    settings {
        end {
            strtotime = midnight +1 day
        }
    }

Relates: #9505
2021-12-06 12:34:32 +01:00
c38241f351 Fix broken upcoming feature
Using a FlexForm results in stored Unixtimestamps.
Adding 00:00 and using strtotime will result in false, resulting in
null.

We now just keep the provided value as integer.
That way underlying code works as expected and delivers events from
given start date.

Relates: #9352, #8581
2021-10-11 11:33:52 +02:00
f0ee19cfae Fix CGL ordering of import statements
Update of dev dependency results in better sorting of UpperCamelCase.
2021-10-11 11:33:11 +02:00
Dirk Koritnik
d5ad0a66a8 Fix probems with catgories
* make sure no empty category is listed in search filter
* fix type error in dd import
2021-09-08 11:03:30 +00:00
22e75d4729 Do not load all dates of each event
Most of the time dates are fetched and shown.
They need the event to show info like title.
But they nearly never need further dates, except in detail view.

Turning this property lazy will save a lot of data fetching and mapping
and provides a huge performance impact.
2021-09-08 10:13:01 +02:00
Dirk Koritnik
ce6d50a7d7 Remove regions from cleanup 2021-09-07 19:01:47 +02:00
da87dc7644 Improve determination of "end" in db constraints
Some dates might not have an end date, but only start.
Those should be respected.
2021-09-07 16:03:54 +02:00
26cc0d3f8c Fix wrong converted condition
The condition was changed when types where properly added.
The actual meaning was changed by accident and is now fixed again.
2021-09-07 15:58:00 +02:00
6226fb32d4 Do not break import if region could not be found 2021-09-07 12:19:49 +02:00
1f769939b4 Extend cleanup
Properly cleanup system.

Delete further records when deleting everything.
Also respect further records when purging old entries.

Respect:

* sys_category_record_mm
* sys_file_reference
* sys_file_metadata
2021-09-07 12:19:09 +02:00
f618536ff9 Add PHPStan
In order to static analyze code and prevent bugs when changing code.
Fix issues in most of the files.
2021-09-07 11:07:55 +02:00
ebb668221e Support canceled attribute during import of destination data
Destination data provides an attribute "DETAILS_ABGESAGT" to mark an
event as canceled.
We now fetch that info and mark all dates of that event as canceled.

This also contains refactoring of creation of dates within import.
All dates had the same info, and are now created at a single place.

Relates: #9280
2021-09-07 09:29:38 +02:00
cbe4eda380 Add CI
* Add first basic CI with defaults.
* Add ecs for coding guideline.
* Fix invalid xliff files.
2021-09-07 09:26:59 +02:00
8ded245785 Fix Category type miss match during import
Extbase Category repository was used, while custom Category instances
were expected.
The repository didn't inherit from Extbase Repository and therefore
didn't provide expected findByUid method.
2021-09-07 08:40:09 +02:00
410a73052e Fix type miss match of object storages
The properties should always be ObjectStorage instances.
We streamline the annotation and initialization to ensure exactly that.

Also import needs small adjustment as it still expected null as possible
return type.
2021-09-07 07:54:43 +02:00
018fdc697e Fix RemoveAllCommand return type
The command should always return an integer as exit code.
The called method does not return anything, resulting in null to be
returned.
2021-09-07 07:54:43 +02:00
d0cb951550 Do not break performance when no postponed date exists
Some sites do not use postponed_date at all.
It would be a massive performance issue to still search for them for
each and every date instance that is created.

This small addition will solve the issue for those pages.
It will still once at least one internal reference is added.

We could then try to add proxies which are build and added, but don't
use the DB. That way the performance would still be okay, and data will
only be fetched when used.
2021-09-07 07:54:43 +02:00
3822b86df6 Fix Category type miss match during import
Extbase Category repository was used, while custom Category instances
were expected.
2021-09-07 07:54:41 +02:00
8ddbc2fb88 Handle missing target folder on import 2021-09-07 07:54:02 +02:00
39d4f628e3 Prevent broken event state when build from db result
The process will not call __construct, the object storages might not be
initialized. Therefore initializeObject is now implemented which is
calling the existing method to initialize object storages.
2021-09-07 07:52:30 +02:00
326378e2fc Allow to reference events from event
This might be useful to allow editors and integrators to create
something like "you might also be interested in" or "related events".
2021-09-07 07:52:29 +02:00