Skip to content

Commit

Permalink
Merge branch '8.1' into 8.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	Neos.Cache/composer.json
#	Neos.Eel/composer.json
#	Neos.Flow/composer.json
#	Neos.FluidAdaptor/composer.json
#	Neos.Kickstarter/composer.json
  • Loading branch information
kitsunet committed Jun 28, 2023
2 parents 9ae9667 + 6998c69 commit b68a5fa
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 35 deletions.
6 changes: 3 additions & 3 deletions Neos.Cache/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"psr/simple-cache": "^2.0 || ^3.0",
"psr/cache": "^2.0 || ^3.0",
"psr/log": "^2.0 || ^3.0",
"neos/utility-files": "*",
"neos/utility-pdo": "*",
"neos/utility-opcodecache": "*"
"neos/utility-files": "self.version",
"neos/utility-pdo": "self.version",
"neos/utility-opcodecache": "self.version"
},
"require-dev": {
"mikey179/vfsstream": "^1.6.10",
Expand Down
8 changes: 4 additions & 4 deletions Neos.Eel/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"description": "The Embedded Expression Language (Eel) is a building block for creating Domain Specific Languages",
"require": {
"php": "^8.0",
"neos/flow": "~8.2.0",
"neos/cache": "*",
"neos/utility-unicode": "*",
"neos/utility-objecthandling": "*"
"neos/flow": "self.version",
"neos/cache": "self.version",
"neos/utility-unicode": "self.version",
"neos/utility-objecthandling": "self.version"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions Neos.Flow.Log/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
],
"require": {
"php": "^8.0",
"neos/utility-files": "*",
"psr/log": "^2.0 || ^3.0"
"psr/log": "^2.0 || ^3.0",
"neos/utility-files": "self.version"
},
"require-dev": {
"phpunit/phpunit": "~9.1"
Expand Down
26 changes: 13 additions & 13 deletions Neos.Flow/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
"ext-reflection": "*",
"ext-xml": "*",

"neos/cache": "~8.2.0",
"neos/eel": "~8.2.0",
"neos/error-messages": "~8.2.0",
"neos/utility-arrays": "~8.2.0",
"neos/utility-files": "~8.2.0",
"neos/utility-mediatypes": "~8.2.0",
"neos/utility-objecthandling": "~8.2.0",
"neos/utility-opcodecache": "~8.2.0",
"neos/utility-schema": "~8.2.0",
"neos/utility-unicode": "~8.2.0",
"neos/flow-log": "~8.2.0",
"neos/http-factories": "~8.2.0",
"neos/cache": "self.version",
"neos/eel": "self.version",
"neos/error-messages": "self.version",
"neos/utility-arrays": "self.version",
"neos/utility-files": "self.version",
"neos/utility-mediatypes": "self.version",
"neos/utility-objecthandling": "self.version",
"neos/utility-opcodecache": "self.version",
"neos/utility-schema": "self.version",
"neos/utility-unicode": "self.version",
"neos/flow-log": "self.version",
"neos/http-factories": "self.version",

"psr/http-message": "^1.0",
"psr/http-factory": "^1.0",
Expand All @@ -52,7 +52,7 @@
"neos/composer-plugin": "^2.0",
"neos/utility-pdo": "~8.2.0",

"composer/composer": "^1.10.22 || ^2.0.13",
"composer/composer": "^2.2.8",

"egulias/email-validator": "^2.1.17 || ^3.0"
},
Expand Down
12 changes: 12 additions & 0 deletions Neos.FluidAdaptor/Classes/Core/Widget/AbstractWidgetViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Neos\Flow\Mvc\Exception\InfiniteLoopException;
use Neos\Flow\Mvc\Exception\StopActionException;
use Neos\Flow\ObjectManagement\DependencyInjection\DependencyProxy;
use Neos\FluidAdaptor\Core\Rendering\RenderingContext;
use Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper;
use Neos\FluidAdaptor\Core\ViewHelper\Facets\ChildNodeAccessInterface;
use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
Expand Down Expand Up @@ -118,9 +119,20 @@ public function initializeArgumentsAndRender()
* Initialize the Widget Context, before the Render method is called.
*
* @return void
* @throws \Exception
*/
private function initializeWidgetContext()
{
/*
* We reset the state of the ViewHelper by generating a new WidgetContext to handle multiple occurrences of one instance (e.g. in a ForViewHelper).
*
* By only calling $this->resetState() we would end in a situation where the RenderChildrenViewHelper could not find its children therefore we move the original children to the new WidgetContext.
* We create new instances of RootNode and RenderingContext in case we got null because setViewHelperChildNodes requires its parameters to be corresponding instances.
*/
$rootNode = $this->widgetContext->getViewHelperChildNodes() ?? new RootNode();
$renderingContext = $this->widgetContext->getViewHelperChildNodeRenderingContext() ?? new RenderingContext();
$this->resetState();
$this->widgetContext->setViewHelperChildNodes($rootNode, $renderingContext);
if ($this->ajaxWidget === true) {
if ($this->storeConfigurationInSession === true) {
$this->ajaxWidgetContextHolder->store($this->widgetContext);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{namespace test=Neos\FluidAdaptor\Tests\Functional\Core\Fixtures\ViewHelpers}<f:for each="{0: 0, 1: 1}" as="value">
<test:someAjax option1="first{value}" option2="second{value}" />
</f:for>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SomeAjaxController::indexAction()
SomeAjaxController::indexAction(option1: "{option1}", option2: "{option2}")
{f:widget.uri(action: 'ajax', ajax: true, arguments: {option1: 'xyz'}) -> f:format.raw()}
{f:widget.uri(action: 'ajaxWithCustomView', ajax: true, arguments: {option1: 'xyz'}) -> f:format.raw()}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public function indexAction()
{
}

public function forIndexAction()
{
}

/**
* Renders and returns the URI pointing to the widget for an AJAX call.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class SomeAjaxController extends AbstractWidgetController
*/
public function indexAction()
{
$this->view->assignMultiple([
'option1' => $this->widgetConfiguration['option1'],
'option2' => $this->widgetConfiguration['option2'],
]);
}

/**
Expand Down
19 changes: 18 additions & 1 deletion Neos.FluidAdaptor/Tests/Functional/Core/WidgetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function ifIncludedInATemplateTheWidgetReturnsResultOfItsOwnIndexAction()
{
$response = $this->browser->request('http://localhost/test/widget/ajaxtest');
[$confirmation,] = explode(chr(10), $response->getBody()->getContents());
self::assertSame('SomeAjaxController::indexAction()', $confirmation);
self::assertSame('SomeAjaxController::indexAction(option1: "value1", option2: "value2")', $confirmation);
}

/**
Expand All @@ -73,6 +73,23 @@ public function theGeneratedUriLeadsToASpecificActionOfTheAjaxController(): void
self::assertSame('SomeAjaxController::ajaxAction("value1", "value2")', trim($response->getBody()->getContents()));
}

/**
* @test
*/
public function ifIncludedInAForViewHelperTheWidgetsKeepTheirDifferentContext(): void
{
$response = $this->browser->request('http://localhost/test/widget/ajaxtest/forIndex');
[$_, $confirmation, $ajaxWidgetUri, $_, $_, $_, $secondConfirmation, $secondAjaxWidgetUri, ] = explode(chr(10), $response->getBody());
self::assertSame('SomeAjaxController::indexAction(option1: "first0", option2: "second0")', \trim($confirmation));
self::assertSame('SomeAjaxController::indexAction(option1: "first1", option2: "second1")', \trim($secondConfirmation));

self::assertNotEquals($ajaxWidgetUri, $secondAjaxWidgetUri);
$response = $this->browser->request('http://localhost/' . $ajaxWidgetUri);
self::assertSame('SomeAjaxController::ajaxAction("first0", "second0")', trim($response->getBody()->getContents()));
$response = $this->browser->request('http://localhost/' . $secondAjaxWidgetUri);
self::assertSame('SomeAjaxController::ajaxAction("first1", "second1")', trim($response->getBody()->getContents()));
}

/**
* @test
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ protected function setUp(): void
$this->viewHelper->injectWidgetContext($this->widgetContext);

$this->objectManager = $this->createMock(\Neos\Flow\ObjectManagement\ObjectManagerInterface::class);
$this->objectManager->expects(self::any())->method('get')->with(\Neos\FluidAdaptor\Core\Widget\WidgetContext::class)->will(self::returnValue($this->widgetContext));
$this->viewHelper->injectObjectManager($this->objectManager);

$this->controllerContext = $this->getMockBuilder(\Neos\Flow\Mvc\Controller\ControllerContext::class)->disableOriginalConstructor()->getMock();
Expand Down
8 changes: 4 additions & 4 deletions Neos.FluidAdaptor/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
],
"require": {
"php": "^8.0",
"neos/flow": "~8.2.0",
"neos/cache": "*",
"neos/utility-files": "*",
"neos/utility-objecthandling": "*",
"neos/flow": "self.version",
"neos/cache": "self.version",
"neos/utility-files": "self.version",
"neos/utility-objecthandling": "self.version",
"typo3fluid/fluid": "~2.7.0",
"psr/log": "^2.0 || ^3.0"
},
Expand Down
6 changes: 3 additions & 3 deletions Neos.Kickstarter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"license": "MIT",
"require": {
"php": "^8.0",
"neos/flow": "~8.2.0",
"neos/fluid-adaptor": "~8.2.0",
"neos/utility-arrays": "*"
"neos/flow": "self.version",
"neos/fluid-adaptor": "self.version",
"neos/utility-arrays": "self.version"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion Neos.Utility.Arrays/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"require": {
"php": "^8.0",
"neos/utility-objecthandling": "*"
"neos/utility-objecthandling": "self.version"
},
"require-dev": {
"mikey179/vfsstream": "^1.6.10",
Expand Down
2 changes: 1 addition & 1 deletion Neos.Utility.Files/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"require": {
"php": "^8.0",
"neos/error-messages": "*"
"neos/error-messages": "self.version"
},
"require-dev": {
"mikey179/vfsstream": "^1.6.10",
Expand Down
2 changes: 1 addition & 1 deletion Neos.Utility.Schema/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"require": {
"php": "^8.0",
"neos/error-messages": "*"
"neos/error-messages": "self.version"
},
"require-dev": {
"mikey179/vfsstream": "^1.6.10",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"symfony/dom-crawler": "^5.1",
"symfony/console": "^5.1",
"neos/composer-plugin": "^2.0",
"composer/composer": "^1.10.22 || ^2.0.13",
"composer/composer": "^2.2.8",
"egulias/email-validator": "^2.1.17 || ^3.0",
"typo3fluid/fluid": "~2.7.0",
"guzzlehttp/psr7": "^1.8.4 || ^2.1.1",
Expand Down

0 comments on commit b68a5fa

Please sign in to comment.