Skip to content

Commit

Permalink
[AllBundles] Symfony 6 compatibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Dec 20, 2023
1 parent 91e23fe commit 964bb08
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function getPossiblePermissions()
*/
public function bindRequest(Request $request)
{
$changes = $request->request->get('permission-hidden-fields');
$changes = $request->request->all('permission-hidden-fields');

if (empty($changes)) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,7 @@ public function getInitializedPermissionAdmin(): PermissionAdmin
public function testBindRequestReturnsTrueWhenNoChanges()
{
$object = $this->getInitializedPermissionAdmin();
$request = $this->createMock(Request::class);
$request->request = $this->createMock(Request::class);
$request->request->expects($this->once())->method('get')->willReturn('');
$request = new Request();
$object->bindRequest($request);
}

Expand All @@ -290,9 +288,7 @@ public function testBindRequest()
$object = $this->getInitializedPermissionAdmin();
$token = $this->createMock(PreAuthenticatedToken::class);
$token->expects($this->once())->method('getUser')->willReturn(new User());
$request = $this->createMock(Request::class);
$request->request = $this->createMock(Request::class);
$request->request->expects($this->any())->method('get')->will($this->onConsecutiveCalls(['ADMIN' => ['ADD' => ['VIEW']]], true));
$request = new Request([], ['permission-hidden-fields' => ['ADMIN' => ['ADD' => ['VIEW']]], 'applyRecursive' => true]);

$mirror = new \ReflectionClass(PermissionAdmin::class);
$property = $mirror->getProperty('tokenStorage');
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/ConfigBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kunstmaanconfigbundle_default:
path: /%kunstmaan_admin.admin_prefix%/settings/config/{internalName}
defaults:
_controller: kunstmaan_config.controller.config:indexAction
_controller: kunstmaan_config.controller.config::indexAction
2 changes: 1 addition & 1 deletion src/Kunstmaan/NodeBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ KunstmaanNodeBundle_nodes:
KunstmaanNodeBundle_urlchooser_replace:
prefix: /%kunstmaan_admin.admin_prefix%/url-replace
path: /replace
defaults: { _controller: kunstmaan_node.url_replace.controller:replaceURLAction }
defaults: { _controller: kunstmaan_node.url_replace.controller::replaceURLAction }
4 changes: 2 additions & 2 deletions src/Kunstmaan/PagePartBundle/PagePartAdmin/PagePartAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function preBindRequest(Request $request)

// Create the objects for the new pageparts
$this->newPageParts = [];
$newRefIds = $request->request->get($this->context . '_new');
$newRefIds = $request->request->all($this->context . '_new');

if (\is_array($newRefIds)) {
foreach ($newRefIds as $newId) {
Expand All @@ -198,7 +198,7 @@ public function preBindRequest(Request $request)

// Sort pageparts again
$sequences = $request->request->get($this->context . '_sequence');
if (!\is_null($sequences)) {
if ($sequences !== []) {
$tempPageparts = $this->pageParts;
$this->pageParts = [];
foreach ($sequences as $sequence) {
Expand Down

0 comments on commit 964bb08

Please sign in to comment.