From d4f02eb742054c1223c03ef34bce836af9f54f03 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Tue, 28 Jan 2025 11:22:56 +0000 Subject: [PATCH] TASK: Add changelog for 9.0.0-beta18 [skip ci] See https://jenkins.neos.io/job/flow-release/461/ --- .../PartV/ChangeLogs/900-beta18.rst | 2816 +++++++++++++++++ 1 file changed, 2816 insertions(+) create mode 100644 Neos.Flow/Documentation/TheDefinitiveGuide/PartV/ChangeLogs/900-beta18.rst diff --git a/Neos.Flow/Documentation/TheDefinitiveGuide/PartV/ChangeLogs/900-beta18.rst b/Neos.Flow/Documentation/TheDefinitiveGuide/PartV/ChangeLogs/900-beta18.rst new file mode 100644 index 0000000000..5995769466 --- /dev/null +++ b/Neos.Flow/Documentation/TheDefinitiveGuide/PartV/ChangeLogs/900-beta18.rst @@ -0,0 +1,2816 @@ +`9.0.0-beta18 (2025-01-28) `_ +============================================================================================================ + +Overview of merged pull requests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`!!! FEATURE: Dispatcher psr overhaul `_ +------------------------------------------------------------------------------------------------------- + +To ease the implementation of a custom controller now use a direct pattern of ``f(ActionRequest) => PsrResponseInterface``. +This is breaking if you implemented your own ``ControllerInterface`` or overwrote low level parts and methods of the ``ActionController``. + + +```php +class Dispatcher +{ + public function dispatch(ActionRequest $request): ResponseInterface; +} + +interface ControllerInterface +{ + public function processRequest(ActionRequest $request): ResponseInterface; +} +``` + +Also, it's discouraged to manipulate ``$this->response`` in controllers (the ``ActionResponse`` is deprecated), although it's still supported in actions for now, please consider returning a new response instead. + +
+ + +Explanation of the legacy MVC response object. + + +Previously Flows MVC needed a single mutable response which was passed from dispatcher to controllers +and even further to the view and other places via the controller context: ``ControllerContext::getResponse()``. +This allowed to manipulate the response at every place. +With the dispatcher and controllers now directly returning a response, the mutability is no longer required. +Additionally, the abstraction offers naturally nothing, that cant be archived by the psr response, +as it directly translates to one: ``ActionResponse::buildHttpResponse()`` +So you can and should use the immutable psr {@see ResponseInterface} instead where-ever possible. +For backwards compatibility, each controller will might now manage an own instance of the action response +via ``$this->response`` ``AbstractController::$response`` and pass it along to places. +But this behaviour is deprecated! +Instead, you can directly return a PSR repose ``\\GuzzleHttp\\Psr7\\Response`` from a controller: + +```php +public function myAction() +{ + return (new Response(status: 200, body: $output)) + ->withAddedHeader('X-My-Header', 'foo'); +} +``` + +
+ +Further the ``ForwardException`` does not extend the ``StopActionException`` anymore, meaning a try catch must be adjusted. + + +This is the main PR and it contains +- https://github.com/neos/flow-development-collection/pull/3232 +- https://github.com/neos/flow-development-collection/pull/3294 + +Followup: https://github.com/neos/flow-development-collection/pull/3301 +Resolves: https://github.com/neos/flow-development-collection/issues/3289 + +This change needs an accompanying adjustment to Neos to adjust the +PluginImplementation as well as Modules: https://github.com/neos/neos-development-collection/pull/4738 + +**Upgrade instructions** + +WIP Upgrade notes: https://github.com/neos/flow-development-collection/pull/3232#issuecomment-1913166370 + + + +* Packages: ``Flow`` + +`!!! FEATURE: update to `doctrine/dbal` version 3 `_ +------------------------------------------------------------------------------------------------------------------- + +update to doctrine/dbal version 3 + +* doctrines json_array type is deprecated, therefore flow_json_array is based off of json type now +* We use PSR6 caches now instead of the deprecated doctrine cache implementation +* New Cache ``Flow_Persistence_Doctrine_Metadata`` for ORM class metadata +* ``Repository::findAllIterator`` directly returns an iterable, the ``Repository::iterate`` method is gone +* All doctrine migration commands have a new optional ``migration-folder`` argument that allows to overwrite the "platform name part" in migration resolving (e.g. "Mysql") as the resolving changed and we cannot be sure deducing it from the current connection will work long term for all cases. Currently MySQL/MariaDB (map to "Mysql"), PostgreSQL (maps to "Postgresql" and SQLite (maps to "Sqlite") all work fine automatically still. + +Related Neos adjustments: https://github.com/neos/neos-development-collection/pull/5161 + +**Upgrade instructions** + +We require now version 3 of ``doctrine/dbal`` but still operate ``doctrine/orm`` in version 2. +In case you depend on DBAL directly you should have a look into their upgrade instructions: https://www.doctrine-project.org/2020/11/17/dbal-3.0.0.html + +* Packages: ``Flow`` + +`!!! FEATURE: `ViewInterface` returns PSR `StreamInterface` `_ +----------------------------------------------------------------------------------------------------------------------------- + +Neos adjustments https://github.com/neos/neos-development-collection/pull/4856 + +- the views are now independent of the ``ControllerContext`` + - ``ViewInterface::setControllerContext`` is not part of the interface anymore and will only be called on demand +- the ``ActionRequest`` if necessary can be accessed via the variable "request" (like "settings") +- ``ViewInterface::canRender`` was required for fallbackviews which have been removed long ago, and so this artefact will be removed as well. +- !!! the return type is now forced to be either a ``ResponseInterface`` or a ``StreamInterface``. Simple strings must be wrapped in a psr stream! (see ``StreamFactoryTrait::createStream``) + +Related to https://github.com/neos/flow-development-collection/pull/3232 + +* Packages: ``Flow`` ``FluidAdaptor`` + +`!!! FEATURE: WIP Dispatcher and controller return `ActionResponse` (simpler controller pattern) `_ +------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +will not be merged directly into 9.0 but included in this mvc overhaul pr: https://github.com/neos/flow-development-collection/pull/3311 + + +This change needs an accompanying adjustment to Neos to adjust the +PluginImplementation as well as Modules. + +~The new ``SimpleActionController`` gives you a direct and simple way to +route an ActionRequest and return an ActionReponse with nothing in +between. Routing should work just like with other ActionControllers.~ + +This is breaking if you implemented your own ControllerInterface +or overwrote or expect some of the api methods of the ActionController. +We now use a direct pattern of f(ActionRequest) => ActionResponse +in more places. Adjusting existing controllers should be easy though. +Additionally implementing your own dispatch loop (don't do this) will +need adjustments. + +We discourage to manipulate ``$this->reponse`` in controllers, +although it should still work fine in actions for now, please consider +other options. + +```php +class Dispatcher +{ + public function dispatch(ActionRequest $request): ActionResponse; +} +``` + +* Packages: ``Flow`` + +`FEATURE: Introduce --help flag option for existing CLI commands `_ +---------------------------------------------------------------------------------------------------------------------------------- + +**Upgrade instructions** + +_None_ + +**Review instructions** + +This change introduces a new way of using the help function for existing Flow/Neos CLI commands. + +Currently you always used: + +```bash +./flow help user:create +``` + +With this change it is possible to use the new ``--help`` flag as an alternative at **the end** of a CLI command: + +```bash +./flow user:create --help +``` + +But of course the first way will also still work! + +### Demo + +https://github.com/neos/flow-development-collection/assets/39345336/4f93f5cf-0435-4344-b37a-0a76b6df7824 + + +* Packages: ``Flow`` + +`FEATURE: Introduce EEL tracer for handling Neos9 deprecations `_ +-------------------------------------------------------------------------------------------------------------------------------- + +Related https://github.com/neos/neos-development-collection/issues/5022 + +In todays weekly @bwaidelich and me discussed a concrete way how to log deprecations like ``node.indentifier`` in Neos 8.4 and 9.0 + +The idea is to add a tracer to eel, that will be implemented in Fusion. Technically we would need to add an abstraction to Neos.Fusion as well to not access the Node from there as this is architecturally illegal but to simplify the code and in light that this is just considered for temporary time we propose to implement it as such: + +```php + true, + 'nodetype' => true, + // ... + ]; + + public function __construct( + private readonly string $eelExpression, + private readonly bool $showMercy + ) { + } + + public function recordPropertyAccess(object $object, string $propertyName): void + { + if ( + $object instanceof \\Neos\\ContentRepository\\Domain\\Model\\Node + && array_key_exists(strtolower($propertyName), self::DEPRECATED_NODE_PROPERTIES) + ) { + $this->logDeprecationOrThrowException( + sprintf('"node.%s" is deprecated in "%s"', $propertyName, $this->eelExpression) + ); + } + } + + public function recordMethodCall(object $object, string $methodName): void + { + } + + private function logDeprecationOrThrowException(string $message): void + { + if ($this->showMercy) { + $this->logger->debug($message); + } else { + throw new \\RuntimeException($message); + } + } +} +``` + + +and instantiate this ``Neos9RuntimeMigrationTracer`` (name tbd) in ``\\Neos\\Fusion\\Core\\Runtime::evaluateEelExpression`` + +```diff +- return EelUtility::evaluateEelExpression($expression, $this->eelEvaluator, $contextVariables); ++ $tracer =.$this->settings['enableDeprecationTracer'] ? new Neos9RuntimeMigrationTracer($expression, $this->settings['strictEelMode'] ?? false) : null; ++ return EelUtility::evaluateEelExpression($expression, $this->eelEvaluator, $contextVariables, $tracer); +``` + + + +**Upgrade instructions** + + +* Packages: ``Flow`` ``Eel`` + +`FEATURE: Support doctrine/dbal 2.x and 3.x `_ +------------------------------------------------------------------------------------------------------------- + +Declares compatibility with ``doctrine/dbal`` 3.x (in addition to the already supported versions ``2.13+``) and adjusts affected code such that it works with both versions + +**Upgrade instructions** + +Any code that (heavily) uses Doctrine DBAL specifics should be checked for compatibility issues. Even if things still work, you may want to replace things deprecated in Doctrine DBAL 3. See https://www.doctrine-project.org/2020/11/17/dbal-3.0.0.html + +One example: You need to replace, as the ``json_array`` type is removed in Doctrine DBAL 3.0. +```php +@ORM\\Column(type="json_array", nullable=true) +``` +with +```php +@ORM\\Column(type="flow_json_array", nullable=true) +``` + +**Review instructions** + +We allow now version 3 of ``doctrine/dbal`` but still only support ``doctrine/orm`` in version 2. + +Related Neos 9 part https://github.com/neos/flow-development-collection/pull/2637 + +* Packages: ``Flow`` + +`FEATURE: Allow `PositionalArraySorter` to keep `null` values `_ +------------------------------------------------------------------------------------------------------------------------------- + +By default, the ``PositionalArraySorter`` removes all ``null`` values. This change makes this behavior an _option_ that can be passed to the constructor: + +```php +(new PositionalArraySorter(['foo' => null]))->toArray(); // [] +(new PositionalArraySorter(['foo' => null], removeNullValues: false))->toArray(); // ['foo'] +``` + +Besides, this cleans up the code and tests + +* Packages: ``Flow`` ``Utility.Arrays`` + +`FEATURE: Introduce PHP 8.2 DNF type support `_ +-------------------------------------------------------------------------------------------------------------- + +The Reflection Service now supports Disjunctive Normal Form (DNF) types for method arguments. + +See: https://www.php.net/releases/8.2/en.php#dnf_types + +* Resolves: `#3026 `_ + +* Packages: ``Flow`` + +`FEATURE: Consider PHP attributes in proxy method building `_ +---------------------------------------------------------------------------------------------------------------------------- + +Added support for preserving PHP 8 attributes in generated proxy class methods. This feature enables correct argument passing from attributes to proxied methods which allows developers to use attributes instead of annotations in most cases. + +* Resolves: `#3075 `_ + +* Packages: ``Flow`` + +`FEATURE: Add `Flow\InjectCache` Attribute / Annotation for property injection `_ +------------------------------------------------------------------------------------------------------------------------------------------------ + +In many cases an ``Objects.yaml`` is created just to inject caches which can feel a bit cumbersome as one already had specified the cache in ``Caches.yaml``. + +To address this the new ``@Flow\\InjectCache`` annotation allows to assign a cache frontend of a configured cache directly to a property without having to configure the ``Objects.yaml`` at all. + +```php + #[Flow\\InjectCache(identifier: 'Flow_Mvc_Routing_Resolve')] + protected VariableFrontend $cache; +``` + + +* Packages: ``Flow`` + +`FEATURE: introduce `UriHelper` to work with query parameters `_ +------------------------------------------------------------------------------------------------------------------------------- + +FYI: This pr was refactored again via https://github.com/neos/flow-development-collection/pull/3336 + +While working on https://github.com/neos/flow-development-collection/pull/2744 and also https://github.com/neos/neos-development-collection/issues/4552 we always came to the conclusion that the ``$queryParameters`` merging of the psr uri is limited. + +This introduces a utility to do this: + + +```php +UriHelper::uriWithAdditionalQueryParameters($this->someUriBuilder->uriFor(...), ['q' => 'search term']); +``` + +and allows us to remove any $queryParam logic from the uribuilder(s) + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`FEATURE: Add `Flow\Route` Attribute/Annotation `_ +----------------------------------------------------------------------------------------------------------------- + +The ``Flow\\Route`` attribute allows to define routes directly on the affected method. This allows to avoid dealing with Routes.yaml in projects in simple cases where is sometimes is annoying to look up the exact syntax for that. + +Usage: + +```php +use Neos\\Flow\\Mvc\\Controller\\ActionController; +use Neos\\Flow\\Annotations as Flow; + +class ExampleController extends ActionController +{ + #[Flow\\Route(uriPattern:'my/path', httpMethods: ['GET'])] + public function someAction(): void + { + } + + #[Flow\\Route(uriPattern:'my/other/b-path', defaults: ['test' => 'b'])] + #[Flow\\Route(uriPattern:'my/other/c-path', defaults: ['test' => 'c'])] + public function otherAction(string $test): void + { + } +} +``` + +To use annotation routes packages have to register the ``AttributeRoutesProviderFactory`` in ``Neos.Flow.mvc.routes`` with Controller classNames or patterns. + +Settings.yaml: +```yaml +Neos: + Flow: + mvc: + routes: + Vendor.Example.attributes: + position: 'before Neos.Neos' + providerFactory: \\Neos\\Flow\\Mvc\\Routing\\AttributeRoutesProviderFactory + providerOptions: + classNames: + - Vendor\\Example\\Controller\\ExampleController +``` + +This pr also adds the general option to register ``provider`` and ``providerOptions`` in the Setting ``Neos.Flow.mvc.routes`` which was required obviously. + +The package: ``WebSupply.RouteAnnotation`` by @sorenmalling implemented similar ideas earlier. + +* Resolves: `#2059 `_ + +**Upgrade instructions** + +**Review instructions** + +Alsow see: `#3324 `_resolving #2060, both solutions ideally would work hand in hand + + +* Packages: ``Flow`` + +`FEATURE: InjectConfiguration for constructor arguments `_ +------------------------------------------------------------------------------------------------------------------------- + +Flow now supports InjectConfiguration attributes for constructor arguments which allows for injecting configuration, such as settings, via the constructor. Compared to property injection, constructor injection results in more portable and better testable code. + +* Resolves: `#3077 `_ + +* Packages: ``Flow`` + +`FEATURE: Introduce PHP 8.2 DNF type support `_ +-------------------------------------------------------------------------------------------------------------- + +The Reflection Service now supports Disjunctive Normal Form (DNF) types for method arguments. + +See: https://www.php.net/releases/8.2/en.php#dnf_types + +* Resolves: `#3026 `_ + +* Packages: ``Flow`` + +`FEATURE: Separate RouteConfiguration from Router `_ +------------------------------------------------------------------------------------------------------------------- + +This separates the Routes configuration from the router by introducing a ``RoutesProviderInterface`` which will be used by the router implementation together with a ``ConfigurationRoutesProvider`` that implements the current configuration from Routes.yaml. + +Switching out the internal implementation of the ``RoutesProviderInterface`` can be done via Objects.yaml to add custom behaviour. But be aware that this is not covered by our api promises. All Implementations should include the routes provided by the ``ConfigurationRoutesProvider``. + +This change also makes sure, that the RouteCommandController uses the current ``RoutesProviderInterface`` implementation, instead of hard coded Flow router. That ensures that all Routes available to the router are now also visible to route cli-commands. + +* Fixes: `#2948 `_ + +**Upgrade instructions** + +This change removes the methods ``getRoutes`` and ``addRoute`` from the Router that previously were mainly used in functional-tests as they were never part of the Router Interface. + +To adjust for that the existing utility ``FunctionalTestCase->registerRoute`` method has to be used instead of ``FunctionalTestCase->router->addRoute``. + +The method ``Router::setRoutesConfiguration``, which was also previously used for internal testing has been removed without official replacement. You _could_ technically inject a custom routes provider to do so but be aware that this is internal behaviour. + +**Review instructions** + +Run the ./flow routing:list command - you will see the list as expected + + +* Packages: ``Flow`` + +`FEATURE: Consider PHP attributes in proxy method building `_ +---------------------------------------------------------------------------------------------------------------------------- + +Added support for preserving PHP 8 attributes in generated proxy class methods. This feature enables correct argument passing from attributes to proxied methods which allows developers to use attributes instead of annotations in most cases. + +* Resolves: `#3075 `_ + +* Packages: ``Flow`` + +`FEATURE: Add `Flow\InjectCache` Attribute / Annotation for property injection `_ +------------------------------------------------------------------------------------------------------------------------------------------------ + +In many cases an ``Objects.yaml`` is created just to inject caches which can feel a bit cumbersome as one already had specified the cache in ``Caches.yaml``. + +To address this the new ``@Flow\\InjectCache`` annotation allows to assign a cache frontend of a configured cache directly to a property without having to configure the ``Objects.yaml`` at all. + +```php + #[Flow\\InjectCache(identifier: 'Flow_Mvc_Routing_Resolve')] + protected VariableFrontend $cache; +``` + + +* Packages: ``Flow`` + +`FEATURE: Add more information for object arguments in debugging `_ +---------------------------------------------------------------------------------------------------------------------------------- + +For stacktraces in exceptions and logs we now render some representation of content for objects to ease debugging with DTOs. + +Specifically we will try to obtain a string representation for such an object by using either in this order: + +- a string cast if __toString() is available +- json_encode if it is JsonSerializable +- json_encode on the array of public properties + +For readability json_encode will be limited to the first level, also all of those string representations will be cut off after 100 characters. + +If any of those options works we will also shorten the className to avoid this output becoming overly long. + +Note that we use JSON_PARTIAL_OUTPUT_ON_ERROR to make sure some output is provided. This might lead to partial or weird outputs depending on the object structure, but might still provide pointers for debugging. + +* Fixes: `#3165 `_ + +* Packages: ``Flow`` + +`9.0 FEATURE: Add `unique` flowQuery operation `_ +---------------------------------------------------------------------------------------------------------------- + +This operation applies ``array_unique`` to the current flowQuery context. + +While the same could previously achieved via ``Array.unique()`` the flow query operation can be placed in an operation chain without extra wrapping. + +**Review instructions** + +There is also a node specific implementation of the ``unique`` operation in https://github.com/neos/neos-development-collection/pull/4355 + +I know the php code looks oldish but the style is in line with the other flowQuery operations around. + + +* Packages: ``Eel`` + +`FEATURE: Add `getAccessorByPath` to `Neos\Utility\Arrays` for type safe accessing of array values `_ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_**Please note that this is an experimental feature and the API is not stable yet.**_ + +The array utility allows to create a type safe accessor via ``Arrays::getAccessorByPath($arrayValue, 'your.path')``. The accessor provides the following methods that will either return the requested type or throw a ``\\UnexpectedValueException``. + +* ``int(): int`` +* ``float(): float`` +* ``number(): int|float`` +* ``string(): string`` +* ``classString(): string`` - with annotation for class-string +* ``array(): array`` +* ``instanceOf(string $className): object`` - with annotation for dynamic type +* ``intOrNull(): ?int`` +* ``floatOrNull(): ?float`` +* ``numberOrNull(): null|int|float`` +* ``stringOrNull(): ?string`` +* ``classStringOrNull(): ?string`` - with annotation for class-string | null +* ``arrayOrNull(): ?array`` +* ``instanceOfOrNull(string $className): ?object`` - with annotation for dynamic type | null + +This will allow to write code that accesses settings via pathes without checking every level for existence still beeing type safe and accessible for static analysis. + +This can be used together with settingInjection. + +```php +public function injectSettings(array $settings): void +{ + $this->limit = Arrays::getAccessorByPath($settings, 'limit')->intOrNull(); +} +``` + +* Resolves: `#3164 `_ + +**Review instructions** + +It may look inefficient to manually throw TypeErrors that in many cases would be thrown automatically because of the declared return types. However this is not a performance issue as those are never on the happy-path and the created TypeError provides additional informations to help understand and fix problems faster. + +Inspired by https://github.com/PackageFactory/extractor + + +* Packages: ``Flow`` ``Utility.Arrays`` + +`FEATURE: Exclude classes from constructor autowiring `_ +----------------------------------------------------------------------------------------------------------------------- + +Classes can now explicitly be excluded from constructor autowiring through a new setting. + +The setting accepts an array of fully qualified class names, each class name being a regular expression. Classes of scope prototype which expect objects to be passed to their constructor are usually considered for autowiring which results in a proxy class being generated. + +This option allows to exclude classes from this process. This is useful for classes like data transfer objects, read models, commands, events and value objects which usually don't rely on dependency injection. + +Flow cannot reliably detect weather a prototype class depends on autowiring for constructor arguments or not. Use this option to optimize your application to avoid the small but measurable overhead of proxy generation for those kinds of classes. + +Note that if there are other reasons than constructor injection which require a proxy class to be generated, the proxy class will be generated no matter what. + +This change partly reverts `#3050 `_because now proxy classes _are_ generated for prototype classes by default. Otherwise a lot of existing Flow applications would not work correctly anymore. + +resolves: #3049 + +* Packages: ``Flow`` + +`FEATURE: Replace self with static in proxy classes `_ +--------------------------------------------------------------------------------------------------------------------- + +Factory methods which use code like new self() for creating a new instance are now handled correctly in proxy classes. The compiler automatically replaces "self" keywords with "static" in the rendered proxy class file to make this possible. + +This implementation has not been optimized for performance. + +* Resolves: `#3059 `_ + +* Packages: ``Flow`` + +`FEATURE: Support private constructors in proxy classes `_ +------------------------------------------------------------------------------------------------------------------------- + +Flow now can correctly build proxy classes for classes with private constructors. Previously, such classes caused errors and proxy class building had to be disabled with the ``Proxy(false)`` annotation. Now classes with private constructors can take advantage of setter and property injection and are considered for advices through the AOP framework. + +* Resolves: `#3058 `_ + +* Packages: ``Flow`` + +`FEATURE: Add support for readonly classes `_ +------------------------------------------------------------------------------------------------------------ + +Flow now respects readonly classes during proxy class building and makes sure that proxy classes are readonly as well. + +resolves: #3025 + +* Packages: ``Flow`` + +`!!!BUGFIX: Make any exception handable in renderingGroups by statusCode `_ +------------------------------------------------------------------------------------------------------------------------------------------ + +Before only exceptions that derive from FlowException could be handled with renderingGroups. This sets the status code for unknown exceptions to 500, so they will match a ``matchingStatusCodes`` configuration. +Therefore a configuration like this will now also render generic exceptions as if they were FlowExceptions with a status code of 500: +```yaml +Neos: + Flow: + error: + exceptionHandler: + renderingGroups: + + 'allExceptions': + matchingStatusCodes: [500] + options: + templatePathAndFilename: 'some-path' +``` + +Note: This is slightly breaking if you handled Flow Exceptions differently than generic exceptions. If you do want to render Flow exceptions differently then generic exceptions, the way to do this is: + +```yaml +Neos: + Flow: + error: + exceptionHandler: + renderingGroups: + + 'flowExceptions': + matchingExceptionClassNames: ['FlowException'] + options: + templatePathAndFilename: 'some-path' + + 'notFound': + matchingStatusCodes: [404] + options: + templatePathAndFilename: 'specific-code-path' + + 'otherExceptions': + matchingExceptionClassNames: ['Exception'] + options: + templatePathAndFilename: 'some-other-path' +``` + +The first matching group will be used. + +* Packages: ``Flow`` + +`BUGFIX: Drop use of `E_STRICT` to fix PHP 8.4 deprecation `_ +---------------------------------------------------------------------------------------------------------------------------- + +The use of ``E_STRICT`` is deprecated as of PHP 8.4, so this fixes deprecation warnings. Furthermore, the constant is no longer useful… + +In PHP 5.4, the functionality of ``E_STRICT`` was incorporated into ``E_ALL``, meaning strict standards notices are included in the ``E_ALL`` error level. As a result, there is no need to use ``E_STRICT`` separately starting with PHP 5.4. This change is documented in the PHP manual under the migration guide for PHP 7.0, which states: + +> All of the E_STRICT notices have been reclassified to other levels. +> The E_STRICT constant is retained, so calls like +> ``error_reporting(E_ALL|E_STRICT)`` will not cause an error. + +(see https://www.php.net/manual/en/migration70.incompatible) + + +* Packages: ``Flow`` + +`BUGFIX: Silence warning in `readCacheFile()` `_ +--------------------------------------------------------------------------------------------------------------- + +readCacheFile() in SimpleFileBackend does fopen(). It wraps it into a try-catch clause and checks the result, but it still produces a warning if the file does not exist: + +``Warning: fopen(/application/Data/Temporary/…): Failed to open stream: No such file or directory`` + +The only way to suppress that warning is to use the shut-up operator (``@``) in this place. Given that everything that can go wrong here is taken care of, I think this is fine. + + +* Packages: ``Flow`` ``Cache`` + +`BUGFIX: Fix race-condition when initializing I18n Service `_ +---------------------------------------------------------------------------------------------------------------------------- + +We noticed in our error logs that we had quite a few errors being thrown from ``here `_/Neos.Flow/Classes/I18n/Service.php#L256-L257>`_: +``` +Call to a member function findBestMatchingLocale() on bool +``` + +My best guess is that this is due to a race-condition when the service is called for the first time on a host by multiple requests simultaneously. + +In general, the pattern of first checking if some value is in the cache, and then reading the value out afterwards without checking it is never safe, as a different process/thread could have removed it. + +The safe way is to read the value out once, and verify that it is set correctly (e.g. it should not ``=== false``). + +I think there's `a few other places `_ that follow the same unsafe pattern, but I suggest that they are addresses separately from this PR. + +I haven't added any tests for this case, but please let me know if you have any ideas of how to test this. + + +* Packages: ``Flow`` + +`BUGFIX: Add missing validation labels `_ +-------------------------------------------------------------------------------------------------------- + +When you use Neos.Form and the Neos.Form.FusionRenderer with the File Upload, there’s a chance that the file extension isn’t valid. In that case, the validation error should be displayed, but the labels are in Flow, and the label for the case is missing. + +This change adds the missing label for the validation error message. + +* Fixes: `#3430 `_ + +* Packages: ``Flow`` ``FluidAdaptor`` + +`BUGFIX: Adjust to PHP 8.3 get_parent_class() deprecation `_ +--------------------------------------------------------------------------------------------------------------------------- + +Somehow, https://github.com/neos/flow-development-collection/pull/3351/files only targeted Flow 9.0, but per the docs, Flow 8.3 also supports PHP 8.3. +This is just a backport of these changes. + +* Packages: ``Flow`` + +`BUGFIX: Fix method param type expansion for partial annotation coverage `_ +------------------------------------------------------------------------------------------------------------------------------------------ + +Adjusts the behavior of ``ReflectionService::getMethodParameters()`` such that ``@param`` annotations are mapped to the corresponding method argument based in their _name_ instead of the _index_. + +* Fixes: `#3423 `_ + +* Packages: ``Flow`` + +`BUGFIX: Don’t load the same files twice in the static resource collection `_ +---------------------------------------------------------------------------------------------------------------------------------------------- + +The second pattern included a 99% subset of the first pattern except the files in the public folders themselves. Therefore all files in subfolders were loaded twice in the ``\\Neos\\Flow\\ResourceManagement\\Collection::getObjects`` method and afterwards also published twice. + +In a medium sized project the first pattern loaded 1165 files and the second pattern 1155 which were all duplicates. + +An additional change is required to deduplicate paths loaded in the ``Collection`` class to prevent further configuration regressions for cases like this. + +* Resolves: `#3417 `_ + +**Review instructions** + +* Delete the ``Web/_Resources/Static`` folder in a demo distribution +* Run ``./flow resource:publish --collection static`` +* Reload the Neos backend and all the static resources like JS and CSS should still be there. + +* Packages: ``Flow`` + +`BUGFIX: Make debugger more robust `_ +---------------------------------------------------------------------------------------------------- + +Prevent exception inception while trying to render debug outputs. + +This can happen when complex objects are encountered in stacktraces and we try to render a string representation. Example would be ``LazyProps`` in Fusion which can easily throw while evaluating. This is especially nasty as it leads to recursions if the original error being rendered occurred while trying to render this same LazyProps object, thus triggering the error handling again. + +The suggested fix covers the whole argument rendering in a try/catch block, as this makes the code even more unreadable it was refactored to separate methods. + +* Packages: ``Flow`` + +`BUGFIX: Fix unit test for changed logging `_ +------------------------------------------------------------------------------------------------------------ + +* See: `#3408 `_ + +* Packages: ``Flow`` ``Flow.Log`` + +`BUGFIX: Always add space between IP and severity in file logs `_ +-------------------------------------------------------------------------------------------------------------------------------- + +For all IP addresses of length 15 or longer (most ipv6 addresses) no space was added between the IP address and the Severity. + +This bugfix always adds a space character between IP and severity. + +**Review instructions** + +Check if IPv6 addresses are separated with a space in log files. + + +* Packages: ``Flow`` ``Flow.Log`` + +`BUGFIX: Fix use of `$this->response->set...` in controllers `_ +------------------------------------------------------------------------------------------------------------------------------ + +Regression from https://github.com/neos/flow-development-collection/pull/3311 + + +And remove declaration of obsolete $dispatched state (followup to https://github.com/neos/flow-development-collection/pull/3294) + + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`BUGFIX: Static compile attribute routes `_ +---------------------------------------------------------------------------------------------------------- + +The necessary reflection data used to build the routes from attributes is not available at (Production) runtime. This is an issue in itself but not trivial to fix, therefore we fix this here by using the ``CompileStatic`` attribute to bring the necessary data over from compile time. + +* Fixes: `#3400 `_ + +* Packages: ``Flow`` + +`BUGFIX: Fix support for typo3fluid/fluid 2.15 `_ +---------------------------------------------------------------------------------------------------------------- + +Adjusts tests that mocked ``AbstractViewHelper::renderChildren()`` that is no longer invoked with version 2.15 + +* Fixes: `#3389 `_ + +* Packages: ``Flow`` ``FluidAdaptor`` + +`BUGFIX: DateTime translation for validator `_ +------------------------------------------------------------------------------------------------------------- + +This will close `#3323 `_ + +* Packages: ``Flow`` + +`BUGFIX: Streamline exit(1) to web response with HTTP status code 500 `_ +--------------------------------------------------------------------------------------------------------------------------------------- + +With this critical error messages like the following now sends the HTTP status code 500 instead 200 in order to state something is not okay on the server side: + +``Flow could not create the directory "/var/www/html/Data/Persistent". Please check the file permissions manually or run "sudo ./flow flow:core:setfilepermissions" to fix the problem. (Error #1347526553)`` + +Resolved: `#3364 `_ + + +* Packages: ``Flow`` + +`BUGFIX: Avoid insecure composer/composer versions `_ +-------------------------------------------------------------------------------------------------------------------- + +This adjusts the dependency to ``~2.2.24 || ^2.7.7`` to avoid versions vulnerable to multiple command injections via malicious branch names. + +More details in: + +- https://blog.packagist.com/composer-2-7-7/ +- https://github.com/advisories/GHSA-v9qv-c7wm-wgmf +- https://github.com/advisories/GHSA-47f6-5gq3-vx9c + + +* Packages: ``Flow`` + +`BUGFIX: First exception cannot be written in subcontext when booting `_ +--------------------------------------------------------------------------------------------------------------------------------------- + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`BUGFIX: Do proper resolving of FusionPathProxy `_ +----------------------------------------------------------------------------------------------------------------- + +Using ``{image.title}`` in Fluid when the image is a ``FusionPathProxy`` does not work. The result is simply ``null`` instead of the image title. + +This change fixes that by moving more code down into our own custom ``TemplateVariableContainer`` from the ``StandardVariableProvider``. + +Fixes `#3357 `_ + +**Review instructions** + +The fixed issue contains instructions on how to reproduce this. + + +* Packages: ``Flow`` ``FluidAdaptor`` + +`BUGFIX: ReflectionService must always initialize `_ +------------------------------------------------------------------------------------------------------------------- + +The ReflectionService lazy loads reflection data from cache, but every method making use of the data needs to call initialize. +This change adds missing calls that seem to never happen first in regular flow applications. Still better to prevent broken reflection in case we optimize other uses in the future. + +* Packages: ``Flow`` + +`BUGFIX: Adjust to Php 83 `get_parent_class` deprecation `_ +-------------------------------------------------------------------------------------------------------------------------- + +see https://www.php.net/manual/en/function.get-parent-class.php + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`BUGFIX: Fix count for query across OneToMany joins `_ +--------------------------------------------------------------------------------------------------------------------- + +The ``Query->count`` now returns the correct count when a criterion is added on a OneToMany relation. + +**Review instructions** + +The problem is described in details in #3331. Same as PR #3342, but this time against the correct branch. + +- [ ] Reviewer - Breaking Changes are marked with ``!!!`` and have upgrade-instructions + +* Packages: ``Flow`` + +`BUGFIX: Pass composer event to update and install scripts `_ +---------------------------------------------------------------------------------------------------------------------------- + +Currently it is not possible to get the composer event in install and update scripts. With this fix it is possible if the script should be interactive, for example: ``$event->getIO()->isInteractive()`` + +* Packages: ``Flow`` + +`BUGFIX: Discover autoloader from FLOW_ROOTPATH rather than __DIR__ `_ +------------------------------------------------------------------------------------------------------------------------------------- + +**The Problem** + +In my development setups (for contribution), I prefer to have every repo that is under development installed via composer ``path`` repositories, like so: + +```json +{ + "name": "vendor/dev-distribution", + "require": { + "neos/flow-development-collection": "9.0.x-dev", + "neos/neos-development-collection": "9.0.x-dev", + "neos/neos-ui": "9.0.x-dev", + "vendor/site": "^1.0" + }, + "repositories": { + "local": { + "type": "path", + "url": "./DistributionPackages/*" + }, + "dev": { + "type": "path", + "url": "./DevelopmentPackages/*" + } + } +} +``` + +Now if I clone, say, ``neos/neos-development-collection`` into ``DevelopmentPackages/``, composer will install the local version rather than the one from packagist. + +This works for ``neos/neos-development-collection``, ``neos/neos-ui`` and pretty much any other package around, but not for ``neos/flow-development-collection``. + +The ``flow`` CLI script makes the assumption that it is always located under ``Packages/*/`` and uses this assumption to discover the ``autoload.php`` script. It does so starting at its own path using the ``__DIR__`` constant. + +Unfortunately, PHP resolves symlinks before it sets the ``__DIR__`` constant. So when flow is installed via symlink, ``__DIR__`` does not contain its symlinked location, but its *real* location. This way it guesses the wrong path for ``autoload.php``, rendering the ``flow`` CLI script unusable. + +**The solution** + +The ``flow`` CLI script also figures out the ``FLOW_ROOTPATH``. It does so just after the autoload discovery. + +I guessed that it would be a safe assumption that the ``autoload.php`` can always be found under ``FLOW_ROOTPATH/Packages/Libraries/autoload.php``. *(though actually, this path may have been configured differently, but flow wouldn't be able to handle that as of right now)* + +Therefore, I moved the composer autload discovery below the ``FLOW_ROOTPATH`` discovery, to then use ``FLOW_ROOTPATH`` as a starting point. + +I'm pretty sure this is applicable to lower branches as well, but I didn't test this yet, so I'm targeting ``9.0`` for now. + +* Packages: ``Flow`` + +`BUGFIX: Dont log stack trace for `InvalidHashException` in Production `_ +---------------------------------------------------------------------------------------------------------------------------------------- + +This configures an ``invalidHashExceptions`` exception handler rendering group and configures it to not dump stack traces in ``Production`` context. For ``Development`` context stack traces are still written to ease debugging. + +* See: `#3159 `_ + +**Upgrade instructions** + +In case you need trace dumps for ``InvalidHashException`` in production context, override the settings as needed. + +**Review instructions** + +* See: `#3159 `_ for ways to trigger those exceptions. Then check if a trace is dumped. + + +* Packages: ``Flow`` + +`BUGFIX: Use configured cache factory `_ +------------------------------------------------------------------------------------------------------- + +The previously used method to select the configured CacheFactory class from the Objects.yaml never returned a result as the raw configuration split by package name was accessed, therefore the fallback was used and it was not possible to provide a custom CacheFactory. + +* Resolves: `#3317 `_ + +* Packages: ``Flow`` + +`BUGFIX: Normalize source type for converting floats to ValueObjects `_ +-------------------------------------------------------------------------------------------------------------------------------------- + +This change allows the ScalarTypeToObjectConverter to convert from floats to ValueObjects. The type converter uses ``gettype()`` which will return ``double`` for ``floats``. As the constructor argument type of the ValueObject is passed through ``TypeHandling::normalizeType()``, it will always be ``float`` and never ``double`` which will lead to floats not being converted by this type converter. + + +* Packages: ``Flow`` + +`BUGFIX: Web-Exception messages preserve whitespace (ASCII Art) `_ +--------------------------------------------------------------------------------------------------------------------------------- + +Closes `#2696 `_ + +Exceptions which have multiple spaces in their $message where previously not as expected displayed. +Exceptions outputted to the CLI or logged did preserve multiple whitespaces naturally, but since they are collapsed in HTML by default, they are not shown in the browser. + +- [x] Code follows the PSR-2 coding style +- [ ] Tests have been created, run and adjusted as needed +- [x] The PR is created against the `lowest maintained branch `_ + +* Packages: ``Flow`` + +`BUGFIX: More descriptive reflection error if attribute does not exist `_ +---------------------------------------------------------------------------------------------------------------------------------------- + +Adds error catching and more context information if an attribute could not be instantiated. + +* Resolves: `#3178 `_ + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Followup 8.3 Revert "BUGFIX: Sanitize uploaded svg files for suspicious contents" `_ +---------------------------------------------------------------------------------------------------------------------------------------------------------- + +Followup `#3249 `_ + +This reverts commit https://github.com/neos/flow-development-collection/commit/`a1642ef31f19a974f34a302c98c13c77b6422ba1 `_ fully for 8.3 + +In the upmerge https://github.com/neos/flow-development-collection/commit/`e2b895120eb00a6c2a352ce22d84f0302b6c3c71 ``_#diff-``b54379d1fdcdc7a8433b179ba5a080f729e68a55 `_9cd2a6203e9d1c49b7789c3e this composer json adjustment in Flow got lost. + +* Packages: ``Flow`` + +`BUGFIX: Fix documentation of `maximumThrowableDump` defaults `_ +------------------------------------------------------------------------------------------------------------------------------- + +* Related: `#3158 `_ + +* Packages: ``Flow`` + +`Revert "BUGFIX: Sanitize uploaded svg files for suspicious contents" `_ +--------------------------------------------------------------------------------------------------------------------------------------- + +As discussed in team meeting, this reverts commit `a1642ef31f19a974f34a302c98c13c77b6422ba1 `_ +as it raises issues when workong with streams (https://github.com/neos/flow-development-collection/issues/3246). + +Original PR: https://github.com/neos/flow-development-collection/pull/3172 + +See also: https://github.com/neos/flow-development-collection/issues/3248 + + + +* Packages: ``Flow`` ``Utility.MediaTypes`` + +`BUGFIX: Assume content exists, if stream size is unknown `_ +--------------------------------------------------------------------------------------------------------------------------- + +If a PSR7 stream is returned from an ``ActionController`` action, no content arrives at the client, if the stream has an unknown size. + +Why is that? Because the check in our ``ActionResponse`` in ``hasContent()`` is implemented like this: + + $this->content->getSize() > 0 + +If a stream returns ``null`` here, because the size is unknown, we should assume content exists... + +There should be no change in behavior, even if the stream is in fact empty. Because that would lead to ``hasContent()`` returning ``true``, and the HTTP response being built in ``ActionResponse`` would get the stream as content. When being delivered that would evaluate to "a stream from an empty string", so there will be (again) no difference, if you look at what the ``MessageTrait``does if the internal stream is ``null``: + +```php + public function getBody(): StreamInterface + { + if (!$this->stream) { + $this->stream = Utils::streamFor(''); + } + + return $this->stream; + } +``` + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`BUGFIX: Update requirements.txt `_ +-------------------------------------------------------------------------------------------------- + +Update requirements to build documentation based on security suggestions. + +* Packages: ``Flow`` + +`BUGFIX: No useless read in `FileBackend` (improve performance) `_ +--------------------------------------------------------------------------------------------------------------------------------- + +``FileBackend::findIdentifiersByTags`` now early returns if ``$tags`` is empty. Otherwise it would read every cache entry completely unnecessarily from the filesystem. + +
+ Profile before + +!`Screenshot_1 `_ + +
+ +
+ Profile after + +Screenshot_2 + +Screenshot_3 + +
+ + +* Packages: ``Flow`` ``Cache`` + +`BUGFIX: Make new object debug output more robust `_ +------------------------------------------------------------------------------------------------------------------- + +Unfortunately magic methods are tricky and __toString is no exception, a check if it's callable can result in true if the magic __call method is implemented but then the results of this call are completely undefined and therefore catching errors and continuing with other options is a good safeguard here. + +Noticed this when I had an error in the ``Mvc\\Arguments`` implementation which declares __call. + +Followup to https://github.com/neos/flow-development-collection/pull/3211 + +* Packages: ``Flow`` + +`BUGFIX: Set InvalidHashException status code to 400 `_ +---------------------------------------------------------------------------------------------------------------------- + +``InvalidHashException`` now declares ``400`` as it's status code (not the inherited ``500`` it has now), as that is clearly a case of a "bad request". + +* See: `#3159 `_ + +**Upgrade instructions** + +This might need adjustment, if you rely on the ``InvalidHashException`` throwing a status code of ``500`` somewhere. + + +* Packages: ``Flow`` + +`BUGFIX: Return the expected result for `is_dir('resource://sha1')` `_ +------------------------------------------------------------------------------------------------------------------------------------- + +* Fixes: `#3225 `_ + + +* Packages: ``Flow`` + +`BUGFIX: Use correct exception class `_ +------------------------------------------------------------------------------------------------------ + +Fix the use of an exception class that is no longer where it was. + + +* Packages: ``Flow`` + +`BUGFIX: Use method to set validated instances container `_ +-------------------------------------------------------------------------------------------------------------------------- + +* Fixes: `#3205 `_ + + +* Packages: ``Flow`` + +`BUGFIX: Require collection packages as `self.version` again `_ +------------------------------------------------------------------------------------------------------------------------------ + +* See: `#3035 `_ for the original change + + +* Packages: ``Flow`` ``Eel`` ``FluidAdaptor`` ``Kickstarter`` + +`BUGFIX: Only set distinct on count clause if explicitely set to improve performance `_ +------------------------------------------------------------------------------------------------------------------------------------------------------ + +F.e. Postgres has performance issues with large datasets and the DISTINCT clause. In a test this change reduced the query time of a count query for ~900.000 entities by >80%. + +In a custom project this affected their Neos Media.UI in which the following results were found: + +* Count all assets | 580ms -> 260ms +* Query 20 assets | 690ms -> 350ms +* Query 100 assets | 990ms -> 650ms +* Module load | 1900ms -> 1400ms + +**Review instructions** + +Everything should work the same, as https://github.com/neos/flow-development-collection/pull/415 already sets the distinct flag where (possibly) necessary. + + +* Packages: ``Flow`` + +`BUGFIX: Sanitize uploaded svg files from suspicious content `_ +------------------------------------------------------------------------------------------------------------------------------ + +Adding an internal methods ``isSanitizingRequired`` and ``sanitizeImportedFileContent`` to the resourceManager. The import is adjusted to first determine the mediaType of an imported resource to decide wether sanitizing is needed which for now happens only for SVG files. If no sanitizing is needed the code will perform as before by passing streams or filenames around. + +If suspicious content was removed from a warning is logged that mentions the remove data and line. The sanitizing is done using "enshrined/svg-sanitize" that is used by other cms aswell. + +The initial implementation will only sanitize SVG files as those can contain malicious scripts. In future this should be expanded to a feature that allows registering of custom sanitizing functions. + +The sanitizing logic itself ist basically the same as what is done by typo3 here: https://github.com/TYPO3/typo3/blob/`357b07064cf2c7f1735cfb8f73ac4a7248ab040e `_/typo3/sysext/core/Classes/Resource/Security/SvgSanitizer.php + +This addresses the issue described here: https://nvd.nist.gov/vuln/detail/CVE-2023-37611 + +**Review Instructions** + +The change adds quite a bit of complexity to the importResource method to avoid loading the file content into ram whenever possible. As this method accepts filenames and resources this leads to quite some nested checking. I consider this kindoff necessary as one does not want to read a full video file into php ram to check wether it may be an svg. + +Better suggestions are welcome. + + +* Packages: ``Utility.MediaTypes`` + +`BUGFIX: Add PDO driverOptions `_ +------------------------------------------------------------------------------------------------ + +This allows to pass driver options for the PDO cache backend, e.g. to make use of SSL, like so: + +```yaml +Flow_Session_Storage: + backend: Neos\\Cache\\Backend\\PdoBackend + backendOptions: + dataSourceName: 'mysql:host=%env:DB_HOST%;dbname=%env:DB_NAME%;charset=utf8mb4' + username: '%env:DB_USER%' + password: '%env:DB_PASSWORD%' + cacheTableName: 'cache_session_storage' + tagsTableName: 'cache_session_storage_tags' + driverOptions: + '%PDO::MYSQL_ATTR_SSL_CA%': 'https://cacerts.digicert.com/DigiCertGlobalRootG2.crt.pem' + '%PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT%': false +``` + +* Fixes: `#3157 `_ + + +* Packages: ``Cache`` + +`BUGFIX: Fix `RedisBackend` to allow scheme in hostname `_ +------------------------------------------------------------------------------------------------------------------------- + +The hostname can hold a scheme, that is needed to enable TLS for the connection: + + tls://127.0.0.1 + +or + + tlsv1.2://127.0.0.1 + +This change fixes the overly naive check for a unix socket to allow using a scheme in the hostname together with a custom port. + +**Review instructions** + +Have an TLS enabled Redis (e.g. free tier on upstash.com) and try to connect to it… + + +* Packages: ``Flow`` ``Cache`` + +`BUGFIX: Allow arrays in `replace`-String-Helper `_ +------------------------------------------------------------------------------------------------------------------ + +The ``str_replace`` function allows arrays as arguments to replace multiple words with other words + +### Here is a simple example: +If you have an array to replace i. e. BB-Codes: + +```yaml +Foo: + Bar: + bbCodes: + '[h2]': '

' + '[/h2]': '

' + '[h3]': '

' + '[/h3]': '

' +``` + +You can usethe helper (with my changes) like this: + +```neosfusion +prototype(Foo.Bar:String) < prototype(Neos.Fusion:Value) { + string = '[h2]Hello[/h2][h3]something[/h3]'; + + search = ${Array.keys(Configuration.setting('Foo.Bar.bbCodes'))} + replace = ${Configuration.setting('Foo.Bar.bbCodes')} + + value = ${String.replace(this.string, this.search, this.replace)} +} +``` + +* Resolves: `#3166 `_ + + +* Packages: ``Flow`` ``Eel`` + +`BUGFIX: Fix `ConfigurationManager::setTemporaryDirectoryBase()` for PHP 8+ `_ +--------------------------------------------------------------------------------------------------------------------------------------------- + +Fixes ``ConfigurationManager::setTemporaryDirectoryBase()`` by replacing the use of the `error control operator `_ that leads to a Warning with PHP 8.0+ + +* Fixes: `#3182 `_ + +* Packages: ``Flow`` + +`BUGFIX: 3129 ProxyClassBuilder php 8.0 fix `get_class_methods` `_ +--------------------------------------------------------------------------------------------------------------------------------- + +* Resolves: `#3129 `_ + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`BUGFIX: Prevent deprecation warning in `RouteTags::createFromArray()` `_ +---------------------------------------------------------------------------------------------------------------------------------------- + +* Fixes: `#3120 `_ + +* Packages: ``Flow`` + +`BUGFIX: Change type hint of returned security logger `_ +----------------------------------------------------------------------------------------------------------------------- + +The type hint for the ``$securityLogger`` was referring to the ``PsrLoggerFactoryInterface`` instead of the correct ``LoggerInterface`` + +Replaces PR `#2998 `_ + + +* Packages: ``Flow`` + +`BUGFIX: improve performance of `Scripts::buildPhpCommand` `_ +---------------------------------------------------------------------------------------------------------------------------- + +https://github.com/neos/flow-development-collection/pull/2491 seems to cause a tiny minor performance regression. Booting minimal flow (only configuration manager), and running Scripts::buildPhpCommand went from ``0.025s`` to ``0.044s`` on my super fast machine ... it might be a more measurable difference on slower systems. + + +using ``exec`` and invoking another php process is just slower than not to. + +Following changes were made: + +A: runtime cache the buildPhpCommand +B: remove the overhead of a second ``exec`` by using first native realpath and only fallback in case of an open base dir restriction to ``exec`` + +see https://github.com/neos/flow-development-collection/pull/2491#issuecomment-1639964461 + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`BUGFIX: Prevent method call in ProxyClassBuilder `_ +------------------------------------------------------------------------------------------------------------------- + +* Fixes: `#3142 `_ + +* Packages: ``Flow`` + +`BUGFIX: Don't pass getValueByPath() argument as reference `_ +---------------------------------------------------------------------------------------------------------------------------- + +This undoes https://github.com/neos/flow-development-collection/commit/`6af168180bbc729197d492f512e2a7e00cfd833d `_ as PHP is clever enough to optimize this these days… + +* Related: `#3142 `_ + +* Packages: ``Flow`` ``Utility.Arrays`` + +`BUGFIX: Deduplication on prePersist `_ +------------------------------------------------------------------------------------------------------ + +Doctrine refactored their IdentityMap, so it checks for duplicated objects already on persist instead of on flush before. + +The way Flow works with ValueObjects allows creating multiple object instances, but they are equal on there persistance identifier. To prevent doctrine from throwing exceptions, because the objects are equal on their persistance identifier we remove one value objects from the IdentityMap if there is an equal one to persist. + +``` + $post1 = new Fixtures\\Post(); + $post1->setAuthor(new Fixtures\\TestValueObject('Some Name')); + + $post2 = new Fixtures\\Post(); + $post2->setAuthor(new Fixtures\\TestValueObject('Some Name')); + + $this->postRepository->add($post1); + $this->postRepository->add($post2); // <-- doctrine would throw an exception here + $this->persistenceManager->persistAll(); +``` + +Until now, flow removes the duplicated value objects on before flush from the list of scheduled insertions, but this is to late now. + +`BUGFIX: JsonArrayType::convertToPHPValue allow null `_ +---------------------------------------------------------------------------------------------------------------------- + +regression from `#2900 `_ + +see https://github.com/neos/flow-development-collection/pull/2900#issuecomment-1674453712 + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`BUGFIX: Support custom table names for PdoBackend `_ +-------------------------------------------------------------------------------------------------------------------- + +Fixes the ``PdoBackend::setup()`` to actually respect any configured ``cacheTableName`` and/or ``tagsTableName``. + +* Fixes: `#2958 `_ + +* Packages: ``Flow`` ``Cache`` ``Utility.Pdo`` + +`BUGFIX: Only publish static collection, if collection is present `_ +----------------------------------------------------------------------------------------------------------------------------------- + +* Fixes: `#3097 `_ + +**Upgrade instructions** + +No changes needed + +**Review instructions** + +Reset the collections configuration like this + +``` +Neos: + Flow: + resource: + collections: [] + storages: [] + targets: [] +``` + +and find the booting throw a exception as "can not call publish() on null" + + +* Packages: ``Flow`` + +`BUGFIX: Fix return type in DocBlock `_ +------------------------------------------------------------------------------------------------------ + +The return type of ``SessionInterface::getData()`` was noted as "array", but in fact is "mixed". + +The returned data is the same unchanged data as passed in ``putData()`` as second parameter, which already was "mixed". All implementations of the ``SessionInterface`` also use "mixed" as return type. + +**Upgrade instructions** + +Nothing to do + +**Review instructions** + +See current implementation of ``TransientSession``: https://github.com/neos/flow-development-collection/blob/`d14198d03d42a0f406565c50d85bcff6dad0f69e `_/Neos.Flow/Classes/Session/TransientSession.php#L132 + + +* Packages: ``Flow`` + +`BUGFIX: Document `Scripts::executeCommand` properly `_ +---------------------------------------------------------------------------------------------------------------------- + +* Related: `#3112 `_ + +``Scripts::executeCommand`` has currently an odd, i suppose historically evolved api https://github.com/neos/flow-development-collection/blob/`1531a8125ad41e62324c7a85e440c14c1cb768ac `_/Neos.Flow/Classes/Core/Booting/Scripts.php#L682 + +1. its not obvious at first what the behavior on error is. The returned status code is actually irrelevant - it will always be true because otherwise we throw an exceptions. +2. the doc commend ``$outputResults if false the output of this command is only echoed if the execution was not successful`` is lying. In case of an error the output is converted into an exception + + +* Packages: ``Flow`` + +`BUGFIX: Uncached ConfigurationManager `_ +-------------------------------------------------------------------------------------------------------- + +### BUGFIX: Proper uncached configurationManager mode + +It is purposely not allowed to disable the cache at runtime (when you have a configuration manager at hand) + +The usage to create a configuration manager without caching, you need to have your own request handler and boot only this step: + +```php +Scripts::initializeConfiguration($this->bootstrap, false); +``` + +--- + +### BUGFIX: ConfigurationManager with disabled cache doesn't replace environment variables in setting + +@kitsunet and me need this for building https://github.com/neos/setup/pull/59 at super early boot time - pre compile time. + +We want to use the config manager without cache, which currently has a bug and you cant really disable the cache unless using reflection to set ``temporaryDirectoryPath`` to null. + +The config manager with disabled cache doesnt replace environment variables in settings. + + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`BUGFIX: harden `Scripts::buildPhpCommand` `_ +------------------------------------------------------------------------------------------------------------ + + +The following changes are included to fix ``Scripts::buildPhpCommand`` + +- ``BUGFIX: Catch stderr output, in case phpPathAndBinary is not found `_>`_ + - we dont want any unnecessary console output +- ``BUGFIX: Make Scripts::buildPhpCommand throw on invalid phpBinaryPathAndFilename `_>`_ + - this is needed for our new setup see https://github.com/neos/setup/pull/59/commits/`9098eb74a37ad250e78c63ad780454cc1dd1b14a ``_ where we ``try catch`` ``buildPhpCommand`` (so we can be sure ``phpBinaryPathAndFilename` is correctly configured beforehand) + - Also since ``buildPhpCommand`` is API anyone using it wants to be assured the php command will also work (point to an existing binary) +- ``BUGFIX: Handle possible fast cgi in phpBinaryPathAndFilename: send empty stdin to close possible fast cgi server `_>`_ + - without this, the setup endpoint might never return on oddly configured webhosting + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`BUGFIX: Allow passing paths as array for settings migrations `_ +------------------------------------------------------------------------------------------------------------------------------- + +This allows to write migrations also for paths with "." (dots) in the path key like: +``` +Neos.Flow.mvc.routes.'Neos.Neos'.variables.defaultUriSuffix +``` + +``` + $this->moveSettingsPaths(['Neos', 'Flow', 'mvc', 'routes', 'Neos.Neos', 'variables', 'defaultUriSuffix'], ['Neos', 'Neos', 'sites', '*', 'uriPathSuffix']); +``` + +As the ``Array::getValueByPath`` and ``Arrays::unsetValueByPath`` already can handle string and array paths, this is a an easy fix. + +`BUGFIX: Wrong time format in log FileBackend - #3121 `_ +----------------------------------------------------------------------------------------------------------------------- + +Fixes a regression from https://github.com/neos/flow-development-collection/pull/3094 + +* Fixes: `#3121 `_ + + +* Packages: ``Flow`` ``Flow.Log`` + +`BUGFIX: Pin doctrine/orm to <2.16.0 `_ +------------------------------------------------------------------------------------------------------ + +After release of 2.16.0 of doctrine/orm the order of created objects has changed. +See: https://github.com/doctrine/orm/issues/10864 + +From Slack: https://neos-project.slack.com/archives/C050KKBEB/p1690915423960539 + +Until this got fixed or we could fix this on our end we need to pin to a version below 2.16.0. + +`BUGFIX: If bytes to read is not > 0, return empty string `_ +--------------------------------------------------------------------------------------------------------------------------- + +* Fixes: `#2929 `_ + +**Upgrade instructions** + + +* Packages: ``Flow`` ``Cache`` + +`BUGFIX: Replacement proxy methods rendered again `_ +------------------------------------------------------------------------------------------------------------------- + +This fixes a bug introduced in d939e6b8 switching to laminuas-code. A proxy method can replace the full body of an existing method or even be a fully new method, in which case only ``body`` will be set in the proxy method. We still want those to be generated. This for example currently breaks the CompileStatic feature, as those methods do not get rendered anymore resulting in worse performance in Production context compared to before. + +This fix renders a proxy method also when a body was set for it, but still skips it if neither pre/post nor body is set. + +It also enabled CompileStatic in Testing Context so that it is testable and adds a test to make sure it works as intended. + +* Fixes: `#3099 `_ + +* Packages: ``Flow`` + +`BUGFIX: Normalize windows package paths `_ +---------------------------------------------------------------------------------------------------------- + +regression from: https://github.com/neos/flow-development-collection/pull/2736 +solves: `#3087 `_ + +Thanks to @icpb and @eartahhj for reporting and helping me debug this ;) + +The root of the problem that flow cant read the packages composer.jsons is because we want to cache the ``packagePath`` + of each package as relative path. (see AvailablePackages.php in your cache folder) +On windows the cache would write include the absolute path. + +This line: +https://github.com/neos/flow-development-collection/blob/`2aefffd8fa3a579d9e1e7d0eed4dba047ba295c7 `_/Neos.Flow/Classes/Package/PackageManager.php#L657 + +should make sure we trim it to an relative path, but because a mismatch of directory separators, the str_replace doesnt work. See example: +```php +# FLOW_PATH_PACKAGES = 'X:/project/packages' # always unix style format + +$fullPackagePath = 'X:\\Project\\packages\\Application\\packageY'; # currently style depends on OS + +str_replace(FLOW_PATH_PACKAGES, '', $fullPackagePath); +``` + +on linux the ``fullPackagePath`` would be ``/project/packages/Application/packageY``, so we use Files::getUnixStylePath to normalize it. + + +It was reported that this problem also appeared in Neos 8.0, but this fix is now written for 8.3, as we refactored the code a little. + +I cant actually believe that starting with Neos 8 it wouldnt work on windows anymore, as this would mean no one used Flow8 with windows. + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`BUGFIX: Remove injected properties before serialization `_ +-------------------------------------------------------------------------------------------------------------------------- + +This fixes a regression introduced recently which resulted in serialization errors if the object to be serialized contained properties which were previously injected. + +* Resolves: `#3066 `_ + +* Packages: ``Flow`` + +`BUGFIX: Support mixed return type in proxied methods `_ +----------------------------------------------------------------------------------------------------------------------- + +Flow's proxy class building now supports mixed return types for methods. + +This change merely adds a test which proves that the feature is working. The actual implementation was part of https://github.com/neos/flow-development-collection/issues/3042. + +resolves: https://github.com/neos/flow-development-collection/issues/2899 + +* Packages: ``Flow`` + +`BUGFIX: Union types in proxy classes `_ +------------------------------------------------------------------------------------------------------- + +Flow's proxy class building now supports union types in method signatures. + +This change merely adds a test which proves that the feature is working. The actual implementation was part of #3042. + +resolves: #2941 + +* Packages: ``Flow`` + +`BUGFIX: No usage of dynamic properties `_ +--------------------------------------------------------------------------------------------------------- + +This patch resolves deprecation notices on PHP 8.2: + +## Dynamic properties in proxy classes +There are some properties that are dynamically declared in proxy classes: +* ``Flow_Injected_Properties`` +* ``Flow_Object_PropertiesToSerialize`` +* ``Flow_Persistence_RelatedEntities``: this is mostly used inside of the ``ObjectSerializationTrait``, so I thought it might make more sense to declare it there instead of adding a property using the ``ProxyClassBuilder`` + +* Resolves: `#2946 `_ + +## ``parent`` inside of closures +There are some methods that will be checked against ``is_callable`` with ``parent::``: +* ``parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray`` +* ``parent::__wakeup`` + +**Review instructions** +* Set up a flow distribution on PHP 8.2 +* Run tests and make sure no deprecation warnings are thrown + + +* Packages: ``Flow`` + +`BUGFIX: Create serialization code for transient properties `_ +----------------------------------------------------------------------------------------------------------------------------- + +Due to a recent optimization, Flow was not generating ``__sleep()`` methods for classes which are not either entities or were configured with a session scope. This led to errors in classes which were using the ``@Transient`` annotation to exclude certain properties from serialization. Therefore, Flow now also generates proxy classes with ``__sleep()`` methods if the original class contains such annotations. + +* Resolves: `#3062 `_ + +* Packages: ``Flow`` + +`BUGFIX: Skip proxy for optional straight values `_ +------------------------------------------------------------------------------------------------------------------ + +When a promoted property was an optional straight value, the proxy class builder decided to create a proxy class because it could be a straight value configured in the object configuration via Objects.yaml. Flow now checks the value of the given argument and only triggers proxy class building if the argument is not null. That way, Flow will not build useless proxies for typical read models which expect a mix of objects and straight values in their constructor. + +related: `#1539 `_ +related: `#3049 `_ + +* Packages: ``Flow`` + +`BUGFIX: Widgets can't be nested in For (Fluid) `_ +----------------------------------------------------------------------------------------------------------------- + +* introduces a test with an AjaxWidgetViewHelper in a ForViewHelper which tests the indexAction and the ajaxAction +* resolved: https://github.com/neos/flow-development-collection/issues/1214 + +**Upgrade instructions** + +**Review instructions** + +The crucial part has a comment in code (AbstractWidgetViewHelper). + + +* Packages: ``Flow`` ``FluidAdaptor`` + +`BUGFIX: Fix proxy compilation for edge cases `_ +--------------------------------------------------------------------------------------------------------------- + +This change fixes proxy compilation for certain cases where "class" +was used as a string in multi-line quoted strings or within comments. + +* Resolves: `#1835 `_ + +* Packages: ``Flow`` + +`BUGFIX: Move access to objectAccess of TemplateObjectAccessInterface into getByPath `_ +------------------------------------------------------------------------------------------------------------------------------------------------------ + +... as accessors are not used anymore for variable provider within fluid, starting v2.8.0. + +Due to the missing accessors the ``objectAccess`` of ``TemplateObjectAccessInterface`` didn't get called anymore, so the result of the ``getByPath`` method was an object of ``FusionPathProxy`` instead of an rendered string. + +See: +https://github.com/TYPO3/Fluid/compare/2.7.4...2.8.0#diff-`a0aa72aa19d9eb57cdb9a4dcd344c3706d75ae7c `_a408286f91a846e495b3c766L122 +https://github.com/TYPO3/Fluid/compare/2.7.4...2.8.0#diff-`a0aa72aa19d9eb57cdb9a4dcd344c3706d75ae7c `_a408286f91a846e495b3c766L341 +https://github.com/TYPO3/Fluid/compare/2.7.4...2.8.0#diff-`a0aa72aa19d9eb57cdb9a4dcd344c3706d75ae7c `_a408286f91a846e495b3c766L312 + + +* Packages: ``FluidAdaptor`` + +`BUGFIX: Prevent type hint errors with latest Fluid minor release `_ +----------------------------------------------------------------------------------------------------------------------------------- + +The 2.8.0 release of Fluid introduced breaking changes (type declarations), thus this changes the dependency to allow only 2.7.x. + +* Resolves: `#3037 `_ + + +* Packages: ``Flow`` + +`BUGFIX: Fix JsonArrayTypeTest `_ +------------------------------------------------------------------------------------------------ + +The JsonArrayTypeTest failed due to an assert() call which stumbled over a missing dependency. + +Additionally, some obsolete tests were removed and tests causing deprecation warnings with PHPUnit 10 were adjusted. Code in Repository::__call() was adjusted to PHP 8 along the way. + +* Packages: ``Flow`` + +`BUGFIX: Relax CachePool key check `_ +---------------------------------------------------------------------------------------------------- + +Adjusts the ``CachePool`` regex that checks the key (aka entry identifier) such that it allows "." as character. + +*Note:* According to https://www.php-fig.org/psr/psr-6/#definitions the regex should be changed to ``/^[a-zA-Z0-9_\\.]{1,64}$/`` (like done in the ``SimpleCache implementation `_/Neos.Cache/Classes/Psr/SimpleCache/SimpleCache.php#L30>`_ – But this is out of scope of this bugfix since it would be a breaking change + +* Fixes: `#2922 `_ + +* Packages: ``Flow`` ``Cache`` + +`!!! TASK: Remove dispatched state from ActionRequest `_ +----------------------------------------------------------------------------------------------------------------------- + +> I will dig a bit into history as I guess something (that obviously no one cares about) was lost in the PSR HTTP refactoring. I think (as we can see in the dispatch loop) there was a possibility before for a controller to gain control but decide it does not finally dispatch the request and thus the dispatch loop would continue and try to find another controller to take care, so it was the controllers responsibility to set this, but I am not sure what conditions it previously attached to it being dispatched. + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`!!! TASK: `Mvc\Dispatcher::afterControllerInvocation` will not be called for CLI requests anymore. `_ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +Reverts that the cli dispatcher invokes the mvc slots dispatcher slots with cli requests. + +When there was one dispatcher the slot ``afterControllerInvocation`` was fired for both cli and web request. (Seemingly only ever at Runtime?) + +Then with the split of web and cli dispatchers this legacy layer was introduced: + +https://github.com/neos/flow-development-collection/commit/`cf55b180c953de8d02adb680216f5c24a3524237 ``_#diff-``2c9408e74a8ac737f84468e74c23956d2057e641 `_96e66b97281905d8697226ca + +Now during a short time the ``Mvc\\Dispatcher::afterControllerInvocation`` signal was now also called for cli request during compile time. + +With this bugfix https://github.com/neos/flow-development-collection/pull/2529 the initial behaviour was restored again. For cli request it will only fire at runtime, and web request are either way always runtime. + +This breaking change cleans up the legacy layer. + +- The original signals ``Mvc\\Dispatcher`` ``'afterControllerInvocation'`` and ``'beforeControllerInvocation'`` + Will be only invoked for action requests. +They still only fire at runtime, as web requests happen at runtime. + +- The with Flow 6.0 introduced signals ``Cli\\Dispatcher`` ``'afterControllerInvocation'`` and ``'beforeControllerInvocation'`` + Will still be only invoked for cli requests. +Will still fired either at compile or runtime, as cli requests can happen always. + +**Upgrade instructions** + +In case you used the MVC signals and relied on it to also be invoked for CliRequest, you need to connect as well to the respective Cli\\Dispatcher signal. But keep in mind that you might need to check if flow is in runtime as this signal will be also fired for compile time unlike the mvc signal before. + + +* Packages: ``Flow`` + +`!!!TASK: Deprecate outdated doctrine functionality `_ +--------------------------------------------------------------------------------------------------------------------- + +In preparation of Flow 9 we deprecate some functionality we expose but that was deprecated in doctrine already, so we will remove it. + +* Packages: ``Flow`` + +`!!! TASK: Deprecate concepts `addQueryString` and `argumentsToBeExcludedFromQueryString` `_ +----------------------------------------------------------------------------------------------------------------------------------------------------------- + +in flows uri building APIs + +See discussion at https://github.com/neos/neos-development-collection/issues/5076 + +Affected Fluid viewhelpers +- ```` +- ```` +- ```` + +Affected PHP APIs +- ``UriBuilder::setAddQueryString`` +- ``UriBuilder::setArgumentsToBeExcludedFromQueryString`` + +**Upgrade instructions** + + +* Packages: ``Flow`` ``FluidAdaptor`` + +`!!! TASK: Refactor uri helpers `_ +------------------------------------------------------------------------------------------------- + +* See: `#3316 `_ + +**Upgrade instructions** + +The following methods were removed from the ``UriHelper`` as they are obsolete and not used. +Its unlikely that the functionality is known and simple to implement yourself. +- ``\\Neos\\Flow\\Http\\Helper\\UriHelper::getUsername`` +- ``\\Neos\\Flow\\Http\\Helper\\UriHelper::getPassword`` +- ``\\Neos\\Flow\\Http\\Helper\\UriHelper::parseQueryIntoArguments`` + +The method ``\\Neos\\Flow\\Http\\Helper\\UriHelper::uriWithArguments`` was renamed to ``\\Neos\\Flow\\Http\\Helper\\UriHelper::uriWithQueryParameters`` to distinct between route values and query parameters which are not the same. +Also it will encode the query parameters after `PHP_QUERY_RFC1738 `_. + +**Review instructions** + +The pr `#3316 `_introduced a new uri helper while we already had one actually. This pr combines the two and cleans things up. + +To ensure the logic of ``uriWithAdditionalQueryParameters`` is not duplicated and possibly handled elsewhere differently the helper is now also used internally by the uriConstraints. + +Also the method has been renamed to better fit the previous sibling ``uriWithArguments``. + +The removed methods are dead code and previously introduced once with Flow 5.1: https://github.com/neos/flow-development-collection/commit/`85408589462b7530180d3dce2858500f29f94bbe `_ +As part of replacements for the old (now removed) flow Uri implementation: + +``Neos\\Flow\\Http\\Uri::getUsername`` -> ``\\Neos\\Flow\\Http\\Helper\\UriHelper::getUsername`` +``Neos\\Flow\\Http\\Uri::getPassword`` -> ``\\Neos\\Flow\\Http\\Helper\\UriHelper::getPassword`` +``Neos\\Flow\\Http\\Uri::getArguments`` -> ``\\Neos\\Flow\\Http\\Helper\\UriHelper::parseQueryIntoArguments`` + +So maybe these methods _are_ known in fact and it would be a bit mean to remove them just because i felt like it and we dont use / test them? + + +* Packages: ``Flow`` + +`!!! TASK: Modernize and clean up session-related code `_ +------------------------------------------------------------------------------------------------------------------------ + +The session-related code in Flow was updated to use modern PHP features and attributes. Classes are also declared as strict and a few minor bugs which surfaced due to type strictness were fixed along the way. + +This change is breaking for anyone who implemented their own implementation of ``SessionInterface`` or ``SessionManagerInterface``because parameter and return types were added. It's very easy to solve though. + +* Packages: ``Flow`` + +`!!! TASK: Deprecate and replace `ActionResponse` in dispatcher `_ +--------------------------------------------------------------------------------------------------------------------------------- + +* Resolves: `#3289 `_ (Contains discussion about the reasoning). + +will not be merged directly into 9.0 but included in this mvc overhaul pr: https://github.com/neos/flow-development-collection/pull/3311 + +_(original pr in christians fork https://github.com/kitsunet/flow-development-collection/pull/5)_ + + +```php +class Dispatcher +{ + public function dispatch(ActionRequest $request): ResponseInterface; +} +``` + +* Packages: ``Flow`` ``FluidAdaptor`` + +`!!! TASK: Make `QueryInterface::logicalAnd` variadic `_ +----------------------------------------------------------------------------------------------------------------------- + +_If_ someone implemented the ``QueryInterface``, the implementation must now use conventional variadic parameters instead of legacy ``func_get_args`` + +This allows phpstan to understand the code ;) + +* Packages: ``Flow`` + +`!!! TASK: Fix `TextIterator::following` and `preceding` `_ +-------------------------------------------------------------------------------------------------------------------------- + +Accidentally they have been typed wrongly. First in phpdoc, which is harmless and later actual types introduced in https://github.com/neos/flow-development-collection/commit/`70b671228ee4f66c54fb7fbfa390aac12b5a71c5 ``_#diff-``947f5937b1e181a6e4ae7bb23349d22d839b073a `_07104b884c08583cc12f63df enforced that. + +The tests didnt fail, because as strict types were not enabled php just cast the int's to string. + +The tests, also casting when using assertEquals, didnt notice that. + + +This is required in preparation for https://github.com/neos/flow-development-collection/pull/3261 + +* Packages: ``Flow`` ``Utility.Unicode`` + +`!!! TASK: Introduce `TargetInterface::onPublish` callback `_ +---------------------------------------------------------------------------------------------------------------------------- + +Currently every implementation of the ``TargetInterface::publishCollection`` should declare a second parameter: ``callable $callback = null`` which not part of the interface, but used by convention. This pattern causes trouble when using phpstan and also it’s not best practice. To improve this code and preserve the usecase partially the interface now allows to register ``onPublish`` callbacks, which should be called when ``publishCollection`` is run: + +```php +interface TargetInterface +{ + // ... + + /** + * @param \\Closure(int $iteration): void $callback Function called after each resource publishing + */ + public function onPublish(\\Closure $callback): void; +} +``` + +**Upgrade instructions** + +In case you are using the callback, you need to adjust the calling side: + +```diff +- $fileSystemTarget->publishCollection($staticCollection, $myPublicationCallback); ++ $fileSystemTarget->onPublish($myPublicationCallback); ++ $fileSystemTarget->publishCollection($staticCollection); +``` + +Also note that the second parameter ``$object`` will not be passed anymore. The callback only contains the ``$iteration`` as one and only parameter. + +Additionally the method ``iterate(…)`` in the ``ResourceRepository`` has been removed, replace it by iterating over the result of ``findAllIterator()`` directly. + + +* Packages: ``Flow`` + +`!!! TASK: Modernized code style in ReflectionService `_ +----------------------------------------------------------------------------------------------------------------------- + +Code in the reflection service was adjusted to the current code style best practices. + +The method arguments in the Reflection Service are now strictly typed. Therefore, third-party code which relied on loose types and passes invalid types, need to be adjusted. Tests in the Flow package were adjusted were necessary. + +As part of the clean up, the setStatusCache() method in ReflectionService was fixed which used a wrong order of parameters in its is_callable() call. + +Preparation for #2913 + +* Packages: ``Flow`` + +`!!! TASK: Require PHP 8.2 `_ +-------------------------------------------------------------------------------------------- + +The minimum requirement for the Flow Framework, including all packages of its distribution, was raised to PHP 8.2. + +* Packages: ``Flow`` ``Utility.ObjectHandling`` + +`TASK: Handle non-integer error codes in throwabe FileStorage `_ +------------------------------------------------------------------------------------------------------------------------------- + +This will no longer swallow certain error codes but instead emit them in the message. + + +* Packages: ``Flow`` + +`TASK: Fix override of runBare() in functional test `_ +--------------------------------------------------------------------------------------------------------------------- + +As of PHPUnit 11 ``runBare()`` is a ``final`` method. + +This was written ages ago by Sebastian Kurfürst, who recently said: + +> IMHO we wanted to run each test twice to run it without cache and +> then with cache. But it seems this was broken anyways since a long +> time – so we can drop it + + +* Packages: ``Flow`` + +`TASK: Run pipeline also in PHP 8.4 `_ +----------------------------------------------------------------------------------------------------- + + + +* Packages: ``Flow`` ``.github`` + +`TASK: Correctly mark nullable method parameters as nullable `_ +------------------------------------------------------------------------------------------------------------------------------ + +Follow up of https://github.com/neos/flow-development-collection/pull/3429 for 9.0 branch after upmerges + +* Packages: ``Flow`` + +`TASK: Fix reflection test `_ +-------------------------------------------------------------------------------------------- + +With 9.0 we get more data from ``ReflectionService::getMethodParameters`` so the test needs to get adapted. + +See: https://github.com/neos/flow-development-collection/pull/3086 + +* Packages: ``Cache`` ``Error.Messages`` ``Flow`` ``FluidAdaptor`` + +`TASK: Correctly mark nullable method parameters as nullable `_ +------------------------------------------------------------------------------------------------------------------------------ + +Replaces `#3427 `_ + +This PR will correctly mark implicit nullable types as nullable, which will remove deprecation warnings in PHP 8.4. + +I've used rector to migrate all occurrences. +https://getrector.com/rule-detail/explicit-nullable-param-type-rector + +See also for Neos: https://github.com/neos/neos-development-collection/pull/5433 + +Note: We should run the rector migration again on 9.0 after upmerging this PR + + +Thanks to @Benjamin-K for bringing this up and providing the first PR (#3427). + +* Packages: ``Cache`` ``Eel`` ``Error.Messages`` ``Flow.Log`` ``Flow`` ``FluidAdaptor`` ``Http.Factories`` ``Utility.Files`` ``Utility.MediaTypes`` ``Utility.ObjectHandling`` ``Utility.OpcodeCache`` ``Utility.Unicode`` + +`TASK: Uniquify exception codes in Abstract(Template)View `_ +--------------------------------------------------------------------------------------------------------------------------- + +Exception codes are supposed to be unique, so this makes sure those places get a code of their own. + +**Upgrade instructions** + +If you rely on that exception code (``1359625876``) for whatever reason, consider taking the new codes into account, too: + +- ``1359625877`` +- ``1359625878`` +- ``1359625879`` +- ``1359625880`` +- ``1359625881`` +- ``1359625882`` +- ``1359625883`` + +**Review instructions** + +You could check if any of the new codes is in use already, in turn… 😬 + + +* Packages: ``Flow`` + +`TASK: Use Symfony ConsoleLogger instead of Doctrine `_ +---------------------------------------------------------------------------------------------------------------------- + +Resolves: https://github.com/neos/flow-development-collection/issues/3404 + +In next minor release (3.9) doctrine/migration will remove the ConsoleLogger +See: https://github.com/doctrine/migrations/pull/1449 + +To prevent any issues after release of this we replace the ConsoleLogger of doctrine with ConsoleLogger of Symfony. + +* Packages: ``Flow`` + +`TASK: Tweak attribute routing docs `_ +----------------------------------------------------------------------------------------------------- + + + +* Packages: ``Flow`` + +`TASK: Use `SCAN` for redis flush `_ +--------------------------------------------------------------------------------------------------- + +This should speed up flush operations and lower the load on Redis. + +**Review instructions** + +The functional tests run ``flush()``… + + +* Packages: ``Cache`` + +`TASK: Drop code for PHP < 8 `_ +---------------------------------------------------------------------------------------------- + +This drops code that was only executed on PHP < 8.0, and thus will never ever be run again. + +* Packages: ``Flow`` + +`TASK: Adjust log level of authentication messages `_ +-------------------------------------------------------------------------------------------------------------------- + +The level of "successfully authenticated token" messages was lowered to "info" and "wrong credentials" messages to "notice". + +Successful authentication of a user is a normal operation and can happen many times within minutes or seconds in highly frequented websites and applications. More often than not, those messages don't require the attention of an administrator. To make it easier for filtering out those messages, the level should really be "info", since it is informational. + +* Packages: ``Flow`` + +`TASK: Update "egulias/email-validator" version constraints `_ +------------------------------------------------------------------------------------------------------------------------------ + +Updates the version constraints of "egulias/email-validator" and allows to use 4.x versions. +Also removes the support of the 2.x versions + +* Packages: ``Flow`` + +`TASK: #3229 Followup improve docs `_ +---------------------------------------------------------------------------------------------------- + +* Related: `#3229 `_ + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Add missing type declaration from Flow 8.3 `_ +------------------------------------------------------------------------------------------------------------------- + +While branching 8.4, this type declaration got lost and should be added again. + +* Packages: ``Flow`` ``FluidAdaptor`` + +`TASK: Remove code related to PHP < 8.2 `_ +--------------------------------------------------------------------------------------------------------- + +Code supporting backwards-compatibility with PHP versions earlier than 8.2 were removed, since the minimum required version for Flow is 8.2. + +* Resolves: `#3085 `_ + +* Packages: ``Flow`` + +`TASK: Benchmark basics `_ +----------------------------------------------------------------------------------------- + +This includes the first set of benchmarks, mainly for testing phpbench but also gives some sensible insights about the framework. + +To run these some more plumbing is needed in BuildEssentials and also the developement distribution. As the benchmarks are not automated yet, nothing should happen with this code for now and it's safe to add. + +Two of the new Testing\\RequestHandlers are used in benchmarks, the third is tentatively for functional tests so they all use the same basis. Using those needs to happen in BuildEssentials though. + +* Packages: ``Flow`` ``Utility.Arrays`` + +`TASK: Introduce internal flow package key value object `_ +------------------------------------------------------------------------------------------------------------------------- + +**Upgrade instructions** + +**Review instructions** + +The concept around the flow package key might be dated, still major parts rely on this and we could use a little strict typing around ^^ + +Also possible refactoring in the future to a composer key might be easier if phpstan can tell us the difference between the types instead of refactoring one string to another. + + +* Packages: ``Flow`` + +`TASK: Deprecate BaseTestCase functionalities `_ +--------------------------------------------------------------------------------------------------------------- + +Flow has a custom extension of php unit mocks, that comes from times of typo3. +Via the accessibly proxy it allows for calling even protected methods and access of protected properties. + +The usage and retrieval ``BaseTestCase::getAccessibleMock()`` has been deprecated as one should not use this for testing. It will lead to a super high coupling of the tests to the super internal implementation which makes refactoring basically impossible (without rewriting major parts of the tests). +In Neos.Neos we see this very well because we are just removing these tests and rewriting them in behat for Neos 9 :D. + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Declare `ValueAccessor` as experimental for now `_ +------------------------------------------------------------------------------------------------------------------------ + +The feature introduce with https://github.com/neos/flow-development-collection/pull/3149 will be marked internal and experimental for now before the stable release of Flow 9.0 + +my reasons for this are +- the feature is not necessary scoped to arrays so ``Neos\\Utility\\Arrays`` might not be the best location +- copy further features from https://github.com/PackageFactory/extractor especially accessing deep array structures with good exceptions: https://github.com/PackageFactory/extractor/blob/`b8a135dbd95c3a51a26787063981ce2454b81dd6 `_/src/Extractor.php#L335 + - or just take the code 1 to 1 +- the naming ``ValueAccessor`` vs ``Extractor`` +- ``Arrays::getAccessorByPath($array, 'path.bar')->int()`` vs ``ValueAccessor::for($array)['path']['bar']->int()`` + - im not sure about if we want to propagate the dot access pattern forever ;) +- we currently dont use the ``ValueAccessor`` ourselves in the code base and thus don't know yet if the api really makes things easier +- it doesn't support forgiving casting / access like ``stringOrIgnore`` +- how to integrate this for validating configuration? https://github.com/neos/flow-development-collection/issues/3043 + + +**Upgrade instructions** + + +* Packages: ``Utility.Arrays`` + +`TASK: Improve help text for doctrine:migrate `_ +--------------------------------------------------------------------------------------------------------------- + +Most users probably didn't know that it is possible to use "prev" or "next" as version names for `./flow doctrine:migrate --version'. This is now documented as part of the help message and additionally the version alias "previous" is automatically converted to "prev" internally. + +* Packages: ``Flow`` + +`TASK: Remove code related to PHP < 8.2 `_ +--------------------------------------------------------------------------------------------------------- + +Code supporting backwards-compatibility with PHP versions earlier than 8.2 were removed, since the minimum required version for Flow is 8.2. + +* Resolves: `#3085 `_ + +* Packages: ``Flow`` + +`TASK: Refactor and optimize of session data storage `_ +---------------------------------------------------------------------------------------------------------------------- + +Before the SessionMetadata and SessionData was written with every request which caused network traffic, storage wear and also made race conditions much more likely when parallel requests changed session data. + +In total this can reduce the number of write operations on the Session caches by 80-90% removing storage and network load as those caches always are persistent and shared across clusters. + +1. The improvements are on top of the Neos 9 already reducing the Flow_Session_Storage write load by not always storing the "lastVisitedNode" in the session. +2. The improvements mostly occur after sending the result "onShutdown" so this will not improve single requests but overall performance and number of parallel requests. + +## 1. SessionMetadataStore / Flow_Session_MetaData + +### Problem + +The session metadata (SessionId, StorageId, LastActivity .. ) is usually written at shutdown of every single request to the session metadata cache even when nothing changed. + +### Optimization + +This is optimized by the new setting ``Neos.Flow.session.updateMetadataThreshold`` that allows to configure the interval for updating the session metadata when nothing but the ``lastActivityTimestamp`` has changed. This removes lots of cache writes and avoids network traffic or storage wear. The session metadata is also converted to a single value object that combines SessionID, StorageID and lastActivityTimestamp. + +## 2. SessionKeyValueStore / Flow_Session_Storage: + +### Problem + +Session data is written to the Flow_Session_Storage cache once Session->putData is called. In case of flow this mostly is the Objects of scope ``@Flow\\Scope("session")`` that are stored on shutdown. Those objects are sometimes modified but during most requests nothing changes here and at the end of the request the same data is added to the cache again with another redundant cache write. + +### Optimization + +The SessionDataStore optimizes this be keeping a hash of the value all previously read keys and avoids writes if the serialized content that is stored yields the same hash. That way only once session-data was actually changed the session objects are actually written to the cache. This also lessens the probability of some race conditions drastically that can occur when multiple parallel requests work on the same session. + +The following redundant behavior was also removed: +- All session metadata records in the cache were previously tagged with ``session`` for iterating over them again. This is replaced by the ``retrieveAll`` method. +- The current authentication providers were always stored in the session data as ``Neos_Flow_Security_Accounts `` but were unused +- Do we want to release this as 8.4 or 9.0? In case of 9.0 the SessionMetaData ValueObject will be adjusted to php 8.1 style. + +Resolves: https://github.com/neos/flow-development-collection/issues/525 + +**Upgrade instructions** + +**Review instructions** + +Some questions during the review could be: +- Are there better ways to determine written objects are modified than comparing hashes of serialized values?: I did not find one. +- Should the comparison of written data with hashes of existing data be implemented in the cache frontend instead?: I think this would consume to much memory we have lots of cache items. + + +* Packages: ``Flow`` + +`TASK: `resource:clean` followup #1678 `_ +-------------------------------------------------------------------------------------------------------- + +While reading the code, looking for improvement, it seems tedious that we ``getIdentifierByObject`` just to ``findByIdentifier`` a few lines later. + +This happened due to a funny history of back and forth. + +At first - 2014 - ``resource:clean`` was introduced looping over the PersistentResource: https://github.com/neos/flow-development-collection/commit/`8a1ce0fba6cb0bf301f971a6d7d5675e0c038d75 `_ + +Then - 2016 - it was decided to save the sha1 and loop over them and retrieve the asset via ``findOneBySha1``: https://github.com/neos/flow-development-collection/commit/`879fba19f93d0a8628682698e57da9f1b58ad7d4 `_ + +But that did not improve the situation as described in https://github.com/neos/flow-development-collection/pull/1678 and was removed again - 2019. + +So in functionality we made a full round, im just here to followup on the last fix to restore the full state syntactically as it was once though of. + +* Packages: ``Flow`` + +`TASK: *PLING PLING* phpstan level 3 `_ +------------------------------------------------------------------------------------------------------ + +~Requires: https://github.com/neos/flow-development-collection/pull/3260~ +~Requires: https://github.com/neos/flow-development-collection/pull/3217~ + +**Upgrade instructions** + + +* Packages: ``Flow`` ``Eel`` + +`TASK: Add type hints and minimal cleanup in object manager `_ +----------------------------------------------------------------------------------------------------------------------------- + +Copied from https://github.com/neos/flow-development-collection/pull/2956 + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: ObjectManagement limit debugBacktrace `_ +-------------------------------------------------------------------------------------------------------------- + +``debug_backtrace`` is expensive, and we are only interested in the second callee. + +* Packages: ``Flow`` + +`TASK: Scripts.php avoid use of same references for exec `_ +-------------------------------------------------------------------------------------------------------------------------- + +Followup to https://github.com/neos/flow-development-collection/pull/3116 + +I debugged with @dlubitz a problem and we found that in theory? $output _might_ be possibly already filled? +I dont know if that can happen but just to be sure we set it to empty as its also a bad practice. + + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Followup ValueAccessor `_ +----------------------------------------------------------------------------------------------- + +followup for `#3149 `_ + +see https://github.com/neos/flow-development-collection/pull/3149#discussion_r1376013861 + +**Upgrade instructions** + + +* Packages: ``Flow`` ``Utility.Arrays`` + +`TASK: Fix errors in Middleware code example `_ +-------------------------------------------------------------------------------------------------------------- + +I found two small errors in the Middleware code example in the documentation. + + +* Packages: ``Flow`` + +`TASK: Ensure `IntegerConverter` converts DateTime to unix time stamp as int `_ +---------------------------------------------------------------------------------------------------------------------------------------------- + +Previously the date was formatted to a unix time stamp, but in string format and not as desired as int. + +This is required in preparation for https://github.com/neos/flow-development-collection/pull/3261 + +* Packages: ``Flow`` + +`TASK: Level up to phpstan 2 (Flow 9 adjustments) `_ +------------------------------------------------------------------------------------------------------------------- + +The upgrade to phpstan level two was introduced via https://github.com/neos/flow-development-collection/pull/3264, this holds the flow 9 specific adjustments. + +Related (phpstan level 1) https://github.com/neos/flow-development-collection/pull/3216 + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Correct doc types StringFrontend::get `_ +-------------------------------------------------------------------------------------------------------------- + +... and document FrontendInterface::get correctly + +This is required for the phpstan migration in Neos Cms ;) + +* Packages: ``Flow`` ``Cache`` + +`TASK: Adjust phpstan command to Neos' dev collection `_ +----------------------------------------------------------------------------------------------------------------------- + +There we also use ``composer run lint:phpstan`` and ``composer run lint`` + +* Packages: ``Flow`` + +`TASK: Phpstan level 2 for Flow 8.3 and ignore to be fixed things `_ +----------------------------------------------------------------------------------------------------------------------------------- + +Flow 9 Pr https://github.com/neos/flow-development-collection/pull/3217 + +**Upgrade instructions** + + +* Packages: ``.github`` ``Eel`` ``Flow`` ``FluidAdaptor`` + +`TASK: Fix some nullable php doc types `_ +-------------------------------------------------------------------------------------------------------- + +I ran phpstan level 3 once on flow. And it seems we dont specifiy the nullable types correctly, but we document them in the doc string. +So i wrote a little helping script that would add the ``|null`` php doc annotation to all ``@param`` and ``@return`` types if we specify ``or NULL`` in the message. I carefully reviewed every change and made additionally some manual changes and corrected things. This is completely non breaking as only doc comments are being touched. + +This will help for migrating to phpstan level 3. + +**Upgrade instructions** + + +* Packages: ``Flow`` ``FluidAdaptor`` + +`TASK: Remove deprecated code `_ +----------------------------------------------------------------------------------------------- + +- remove deprecated ProtectedContext::whitelist +- remove deprecated Http Component legacy layer + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Change version constraints for Neos packages to self.version `_ +------------------------------------------------------------------------------------------------------------------------------------- + + + +* Packages: ``Kickstarter`` + +`TASK: Correct symfony dependencies in Flow composer.json `_ +--------------------------------------------------------------------------------------------------------------------------- + +The upmerge commit ``e2b895120eb00a6c2a352ce22d84f0302b6c3c71 ``_`` wrongly removed symfony 6.0 in the version constraints of ``neos/flow``. + +* Relates: `#2999 `_ + +* Packages: ``Flow`` + +`TASK: Correct Flow composer.json `_ +--------------------------------------------------------------------------------------------------- + +The upmerge commit `42e3fd7886d5bed317511a2046d4119867216923 `_ wrongly overwrote major parts of Flows composer.json, introducing older versions of PHP and psr/log as well as removing dependencies on some other psr packages. This change corrects the issue and needs to be upmerged accordingly. + +The changes were never merged into the collection composer.json so that the issue was not noticed in development environments. + +* Packages: ``Flow`` + +`TASK: Remove Bootstrap::MINIMUM_PHP_VERSION `_ +-------------------------------------------------------------------------------------------------------------- + +We declare these dependencies in composer and it should not be necessary to validate them at runtime. + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Add PHP 8.3 to build workflow matrix `_ +------------------------------------------------------------------------------------------------------------- + +This will test Flow against PHP 8.3 + + +* Packages: ``Eel`` ``Flow`` ``FluidAdaptor`` ``Kickstarter`` + +`TASK: Update default .htaccess for _Resources `_ +---------------------------------------------------------------------------------------------------------------- + +PHP 5 is a thing of the past, but for PHP 8 the module is name just ``mod_php.c``, so that needs to be added. + +**Upgrade instructions** + +Depending in the way you deploy and whether you have that file even in version control, the change might need to be applied manually to your setup. + + +* Packages: ``Flow`` + +`TASK: Routing Documentation Adjustment `_ +---------------------------------------------------------------------------------------------------------- + +Correction of an erroneous path in routing documentation. + +* Packages: ``Flow`` + +`TASK: Use generics via @template instead of PHPSTORM_META `_ +---------------------------------------------------------------------------------------------------------------------------- + +Since the php universe evolved im gonna try https://github.com/neos/flow-development-collection/pull/2753 again ;) + +Adds typings to: + +\\Neos\\Flow\\ObjectManagement\\ObjectManagerInterface::get() + +and + +\\Neos\\Flow\\Core\\Bootstrap::getEarlyInstance() + +by usage of the @template tag: https://phpstan.org/writing-php-code/phpdocs-basics#generics + +This feature is supported by phpstorm, psalm and phpstan and also used widely in Neos 9 + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Remove dead AfterInvocation related code `_ +----------------------------------------------------------------------------------------------------------------- + +This was never properly implemented. + + +* Packages: ``Flow`` + +`TASK: Remove persistence clone magic `_ +------------------------------------------------------------------------------------------------------- + +This removed the code that set ``Flow_Persistence_clone`` in entities or value objects when they were ``clone``d. + +As dynamic properties are deprecated with PHP 8.2, this caused warnings and will eventually break. + +Since this was (re)-introduced in Flow 2 via `90cb65827c1550e9144e9f83b9231b430c106660 ``_ to support custom backends in the geenric persistence layer of Flow, like the (now outdated) ``TYPO3.CouchDB`, we felt it is best to remove it. + +**Upgrade instructions** + +If you rely on this, you need to adjust your code. Chances are, if you still need this, you use the generic peristsnece layer, which is gone in Flow 7 aready (see https://github.com/neos/flow-development-collection/pull/1769 and https://github.com/neos/flow-development-collection/pull/2262). So, you have other problems to solve, anyway… + + +* Packages: ``Flow`` + +`TASK: Migrate to PHPStan (adjustments in Flow 9) `_ +------------------------------------------------------------------------------------------------------------------- + +With https://github.com/neos/flow-development-collection/pull/3218 PHPStan level 1 was added to the whole Flow code base and CI for Flow 8. This upmerged change needs some adjustments to pass the CI in Flow 9 + +- fix types in code that was introduced with Flow 9 +- fix types where neos depends on it (by correcting types and adding ``never``) +- adjust unit test as ``never`` cannot be doubled (eventually this will be fixed via: https://github.com/sebastianbergmann/phpunit/issues/5048) +- fix ci and style as neos 9 followup for https://github.com/neos/flow-development-collection/pull/3218 + + +* Packages: ``Eel`` ``Flow`` ``FluidAdaptor`` ``Kickstarter`` ``Cache`` + +`TASK: Migrate to PHPStan for Flow 8 `_ +------------------------------------------------------------------------------------------------------ + +This is a backport of https://github.com/neos/flow-development-collection/pull/3216 + +Adds PHPStan level 1 to the whole Flow code base and CI. +Psalm was removed. + + +* Packages: ``Flow`` ``.github`` ``Cache`` + +`TASK: PEG Parser declares properties `_ +------------------------------------------------------------------------------------------------------- + +Prevents deprecation warnings for dynamic properties. + +* Packages: ``Flow`` ``Eel`` + +`TASK: Carefully fix psalm types across codebase to make it green ;) `_ +-------------------------------------------------------------------------------------------------------------------------------------- + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Update default settings for stored throwable dumps `_ +--------------------------------------------------------------------------------------------------------------------------- + +This updates the default settings in YAML to 30 days of dump retention and a maximum of 10.000 files. + +The class properties keep their ``0`` default, so that in case the class has been extended no change is enforced. + +**Review instructions** + +Needs upmerge of https://github.com/neos/flow-development-collection/pull/3187 + + +`TASK: Use new Behat `FlowBootstrapTrait` `_ +----------------------------------------------------------------------------------------------------------- + +Adjust to behat adjustments see https://github.com/neos/behat/pull/35 + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Clean up stored throwable dumps `_ +-------------------------------------------------------------------------------------------------------- + +Whenever a new dump is written, check the existing dumps and remove those that are older than allowed or exceed the maximum count. + +By default nothing is cleaned up. + +* Resolves: `#3158 `_ + +**Review instructions** + +Should remove old dump files as configured… + + +* Packages: ``Flow`` + +`TASK: Fix overlooked dependency… `_ +----------------------------------------------------------------------------------------------------- + +* See: `#3035 `_ for the original change + + +* Packages: ``Flow`` + +`TASK: Fix cache RedisBackend unittest `_ +-------------------------------------------------------------------------------------------------------- + +A test failed due to a missing return value from a method not being mocked (correctly), + + +* Packages: ``Cache`` + +`TASK: Fix documentation builds `_ +------------------------------------------------------------------------------------------------- + +… by pinning updated dependencies. + +**Review instructions** + +Best is to see if the builds succeed on RTD again with this merged… + + +* Packages: ``Flow`` + +`TASK: Fix cache RedisBackend unittest `_ +-------------------------------------------------------------------------------------------------------- + +A test failed due to a missing return value from a method not being mocked (correctly), + + +* Packages: ``Flow`` ``Cache`` + +`TASK: document and deprecate flows internal isolated behat tests `_ +----------------------------------------------------------------------------------------------------------------------------------- + +Related https://github.com/neos/flow-development-collection/issues/3170 + +The infrastructure is quite complex and not in relation to those two tests. That's why we declare it ready to be removed. + +**Upgrade instructions** + + +* Packages: ``Flow`` + +`TASK: Avoid potential deprecation warning in StringHelper `_ +---------------------------------------------------------------------------------------------------------------------------- + +``str_replace()`` expects strings, but Eel with it's loose typing might pass in different types. + + +* Packages: ``Flow`` ``Eel`` + +`TASK: Fix settings for reference rendering `_ +------------------------------------------------------------------------------------------------------------- + +Since 4.0.0 the ``neos/doctools`` package expects the configuration in a different way. This lead to "hidden" errors during reference renedering on Jenkins. + +**Review instructions** + +This fixes errors like this: + +``` +15:37:24 Rendering Reference "0" +15:37:24 Neos\\DocTools\\Command\\ReferenceCommandController_Original::renderReference(): Argument `#1 `_($reference) must be of type string, int given, called in /var/lib/jenkins/workspace/Flow - update references/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_DocTools_Command_ReferenceCommandController.php on line 90 +15:37:24 +15:37:24 Type: TypeError +15:37:24 File: Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_DocTools_Com +15:37:24 mand_ReferenceCommandController.php +15:37:24 Line: 98 +``` + +Can be reproduced by doing this in a Flow development setup: + +``` +composer require --no-interaction --no-progress neos/doctools +./flow reference:rendercollection Flow +``` + + +* Packages: ``FluidAdaptor`` + +`TASK: Update actions/checkout in add-pr-labels action `_ +------------------------------------------------------------------------------------------------------------------------ + +Switches to a version that uses Node 16. The same is needed for the ``actions-ecosystem/action-add-labels``, but that has not been released since 2020… +**Review instructions** + +After a run, check the action output and make sure the deprecation warning is gone. + + +* Packages: ``Flow`` ``.github`` + +`TASK: PHP 8.1 deprecations compatibility `_ +----------------------------------------------------------------------------------------------------------- + +This tweaks the code so that it runs without deprecations on PHP 8.1. + +**Upgrade instructions** + +None. + +**Review instructions** + +None. + + +* Packages: ``Flow`` + +`TASK: Apply fixes from StyleCI `_ +------------------------------------------------------------------------------------------------- + +This pull request applies code style fixes from an analysis carried out by `StyleCI `_. + +--- + +For more information, click `here `_. + +* Packages: ``Flow`` ``Utility.ObjectHandling`` + +`TASK: Support PHP never, null, false, and true as stand-alone types `_ +-------------------------------------------------------------------------------------------------------------------------------------- + +This change adds functional tests to prove that Flow can handle PHP 8 stand-alone return types in AOP proxy class building. + +Note that "null" is not supported yet by laminas-code, therefore the corresponding test is not active yet. + +* Resolves: `#3027 `_ + +* Packages: ``Flow`` + +`TASK: Use Laminas Code for proxy method rendering `_ +-------------------------------------------------------------------------------------------------------------------- + +Flow now uses laminas/laminas-code for rendering proxy methods. The Dependency Injection Proxy Class Builder was refactored and the classes ProxyConstructor and ProxyMethod were replaced by new implementations called ProxyConstructorGenerator and ProxyMethodGenerator respectively. + +* Resolves: `#3042 `_ + +* Packages: ``Flow`` + +`TASK: Clean up code in AOP and ObjectManagement `_ +------------------------------------------------------------------------------------------------------------------ + +This change contains various code clean-ups which fell off with the preparation of a new bug fix for AOP. + +* Packages: ``Flow`` + +`TASK: Replace "adviced" by "advised" `_ +------------------------------------------------------------------------------------------------------- + +Fixed a good old typo everywhere in Flow by replacing all occurrences of "adviced" by "advised". + +* Packages: ``Flow`` + +`TASK: Clean up functional tests for AOP `_ +---------------------------------------------------------------------------------------------------------- + +This also re-activates a functional test targeting PHP 7.1 features which was disabled at some point in history. + +* Packages: ``Flow`` + +`TASK: Only add constructor injection code if needed `_ +---------------------------------------------------------------------------------------------------------------------- + +The proxy class builder now skips code generation for constructor injection code if the given original class is prototype, no user-defined object configuration exists and all potentially autowired constructor arguments are prototypes or simple values. This change should result in a significantly less amount of proxy classes generated in most modern Flow projects. + +resolves: `#3049 `_ +resolves: #1539 + +* Packages: ``Flow`` + +`TASK: Only add serialization entities code if needed `_ +----------------------------------------------------------------------------------------------------------------------- + +Proxy classes created by the Dependency Injection Proxy Class Builder now only contain code related to serialization and deserialization of related entities if needed. + +The code is only rendered if one of the following conditions is met: + +- The class is annotated with Entity +- The class is annotated with Scope("session") + +Despite the previous condition, the code will not be rendered if the following condition is true: + +- The class already has a __sleep() method (we assume that the developer wants to take care of serialization themself) + +As part of this change, the generated code related to serialization was slightly adjusted for stricter type handling. + +related: `#1539 `_ + +**Review instructions** + +- try to find an existing application which relies on serialization of related entities, for example a Flow application which uses ORM with relations or uses entities in a session scope. +- remove all caches and then access your application in a browser using the current Flow 9 branch (without this patch) +- create a backup of the Cache/Code/Flow_Object_Classes directory +- switch to a branch with this change, remove all caches and access the application again in a browser +- use a diff tool (e.g. Kaleidoscope) to compare both cache directories to see what is now different +- check if your application still works + +* Packages: ``Flow`` + +`TASK: Require all collection packages as `self.version` `_ +-------------------------------------------------------------------------------------------------------------------------- + +Any dependency from one package in the collection to another should always be "to the same version". + +This changes makes sure this is the case by using ``self.version`` as the required version. + +See `#3034 `_ + + +* Packages: ``Flow`` ``FluidAdaptor`` + +`TASK: Test count returned by TaggableMultiBackend.flushByTag `_ +------------------------------------------------------------------------------------------------------------------------------- + +This makes sure the count of flushed entries returned by ``flushByTag()`` is calculated in a more readable way. + +* Fixes: `#2892 `_ + +**Review instructions** + +The new test proves it… + + +* Packages: ``Flow`` ``Cache`` + +`Detailed log `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~