Comments (5)
I think were talking slightly past each other. addQueryString
is a boolean flag:
:addQueryString: (boolean) Whether to keep the query parameters of the current URI
:argumentsToBeExcludedFromQueryString: (array) Query parameters to exclude foraddQueryString
That means its yes is separate from the routing - currently handled by Flows uri builder - but might still not be sensible to reimplement.
The flow uribuilder code is obscured due to the nature of subrequests but its current implementation looks like this: https://github.com/neos/flow-development-collection/blob/32055e5c966579509a3ec06a3520b246696bcdc4/Neos.Flow/Classes/Mvc/Routing/UriBuilder.php#L452:
protected function mergeArgumentsWithRequestArguments(array $arguments)
{
// ... (sub-request stuff) ...
if ($this->request->isMainRequest() && $this->addQueryString === true) {
$requestArguments = $this->request->getArguments();
foreach ($this->argumentsToBeExcludedFromQueryString as $argumentToBeExcluded) {
unset($requestArguments[$argumentToBeExcluded]);
}
if ($requestArguments !== []) {
$arguments = Arrays::arrayMergeRecursiveOverrule($requestArguments, $arguments);
}
}
return $arguments;
}
That means to archive the same feature without these little helpers, one could write this in Fusion:
- root = Neos.Fusion:NodeUri {
- addQueryString = true
- argumentsToBeExcludedFromQueryString = ${['bar']}
- }
+ root = Neos.Fusion:NodeUri {
+ additionalParams = ${request.arguments.filter((value, key) => key != 'bar')}
+ }
Alternatively with a proper introduction of queryParameters
as option for fusion that will use the new UriHelper::uriWithAdditionalQueryParameters
(neos/flow-development-collection#3316) one could even use queryParameters
directly instead of the to be deprecated additionalParams
that leverage append exceeding arguments internally. Basically we definitely want #3914 for 9.0. (Or maybe for even back-ported for 8.x)
As it seems to be easier than assumed to offer a b/c layer in Fusion, where we still have the action request at hand, i could reimplement it for 9.0
from neos-development-collection.
This should also be removed from the flow UriBuilder
from neos-development-collection.
I would drop argumentsToBeExcludedFromQueryString
for now.
We could make the queryString manipulation for addQuerystring
be a part of the fusion implementation instead of passing this down? ala fusion lets the router create an Uri and then just appends a given query string (DataStructure?) to this Uri object? that would be trivial to implement and removes the feature from routing.
from neos-development-collection.
Right yeah the bool is meh it can go I guess
from neos-development-collection.
Actually i could imagine implementing it like:
$nodeUriBuilder->uriFor($nodeAddress, Options::create()->withAddedQueryString($actionRequest, excludedArguments: ['bar']);
its just an odd api, but would work and re enable the usecase for the LinkingService, NodeUri in Fusion & Fluid for Neos 9.0
But with the expense of carrying this thing around another time - till Neos 10. I think the additionalParams = ${request.arguments}
"hack" is more than enough for people really relying on this dated feature.
from neos-development-collection.
Related Issues (20)
- BUG: "Adopting" a node ignores URI of parent(s)
- FEATURE: Add helpers to fetch nodes in ways similar to `context()` operation HOT 5
- Remove `WorkspaceStatus::OUTDATED_CONFLICT`?
- !!! TASK: Prefer value objects over `array` or `iterable` in ESCR core
- EPIC: Keeping track of Neos 9 compatible package HOT 1
- 9.0 Neos service routes not working
- BUG after upgrade from 8.3.12 to 8.3.13: deleting nodes does not flush relevant caches HOT 12
- FEATURE: upgrade FontAwesome to latest version (6.5.2) HOT 1
- FEATURE: More flexible id for NodeAggregate HOT 5
- Discussion: Default dimension / default context in the new CR
- RFC: Performance Benchmarks and Tests HOT 1
- BUG: Prevent multiple/parallel imports of external asset source assets HOT 1
- `WorkspaceName` is far too permissive HOT 1
- DISCUSSION: Improve our existing CLI commands in Flow/Neos HOT 8
- BUG: Can't switch from internal workspace back to live HOT 2
- Code Style: Unify php file licence headers and their position
- BUG `ImageVariantGarbageCollector` is never triggered in Neos 9
- BUG: ContentReference doesn't show hidden status of referenced node in backend HOT 1
- BUG: Discarded node remains in cache if UI was reloaded between creation and discard HOT 2
- Fix `EmbedsContentStreamAndNodeAggregateId` interface for ESCR Events
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neos-development-collection.