-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TASK] Directly parse request body as associative array #106
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Removes compatibility code for versions below v11 and upgrades composer dependencies.
It is now possible to configure how empty files are handled. The extension configuration property `handleEmptyFile` can be set to these values: 0: Treat as any other file. You can also use this option if you want to handle empty files with a custom `Pixelant\Interest\DataHandling\Operation\Event\BeforeRecordOperationEvent`. Just make sure your EventHandler it is executed after `\Pixelant\Interest\DataHandling\Operation\Event\Handler\PersistFileDataEventHandler`. 1: Stop processing the record. This might result in pending relation records that will never be resolved in the database, but if that's OK for you it won't cause any issues. 2: Fail. The operation will be treated as failed and returns an error.
Removes compatibility code for versions below v11 and upgrades composer dependencies.
It is now possible to configure how empty files are handled. The extension configuration property `handleEmptyFile` can be set to these values: 0: Treat as any other file. You can also use this option if you want to handle empty files with a custom `Pixelant\Interest\DataHandling\Operation\Event\BeforeRecordOperationEvent`. Just make sure your EventHandler it is executed after `\Pixelant\Interest\DataHandling\Operation\Event\Handler\PersistFileDataEventHandler`. 1: Stop processing the record. This might result in pending relation records that will never be resolved in the database, but if that's OK for you it won't cause any issues. 2: Fail. The operation will be treated as failed and returns an error.
Use `getDataForDataHandler()` and `setDataForDataHandler()` instead.
Reduces code by rewriting HttpBackendUserAuthentication to use more functionality from TYPO3 core.
Moves deprecated method declaration into separate class.
This reverts commit 93aa637
To try to avoid triggering the autoloader.
To try to avoid triggering the autoloader.
Due to the changes in BackendUserAuthentication between TYPO3 v11 and v12, we have to load different versions of the HttpBackendUserAuthentication class on runtime.
UpdateRecordOperationTest has been updated so $imageUpdates is no longer overwritten in the foreach loop. Fixes #103
Versions below this will fail in TYPO3 v12 due to a missing fallback. See: TYPO3/testing-framework#497
The HTTP request body was previously first parsed into objects and then converted to an array. This was done to be able to detect the difference between record data and nested table/recordId/language/workspace arrays. This can instead be implemented using `array_is_list()`. `symfony/polyfill-php81` provides a polyfill for PHP versions below 8.1. This commit also adds an optional third parameter, `?array $parsedBody = null`, to `\Pixelant\Interest\RequestHandler\AbstractRecordRequestHandler::__construct()`. This parameter makes it possible to supply a parsed JSON body as associative array to avoid parsing JSON twice.
mabolek
changed the title
[TASK] Directly parse request body as associative array
[WIP][TASK] Directly parse request body as associative array
Sep 13, 2023
* Rename `$decodedContent` to `$parsedBody` * Correctly set metadata * Throw exception on JSON decode error * Fetch and parse request body in separate method
This reverts commit ee5574c.
mabolek
changed the title
[WIP][TASK] Directly parse request body as associative array
[TASK] Directly parse request body as associative array
Nov 1, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one small feedback!
MattiasNilsson
approved these changes
Nov 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The HTTP request body was previously first parsed into objects and then converted to an array. This was done to be able to detect the difference between record data and nested table/recordId/language/workspace arrays. This can instead be implemented using
array_is_list()
.symfony/polyfill-php81
provides a polyfill for PHP versions below 8.1.This commit also adds an optional third parameter,
?array $parsedBody = null
, to\Pixelant\Interest\RequestHandler\AbstractRecordRequestHandler::__construct()
. This parameter makes it possible to supply a parsed JSON body as associative array to avoid parsing JSON twice.