Skip to content
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1140327
add sulu 3.0 support
wachterjohannes Aug 22, 2025
4bc20b2
Remove unsupported php version from checks
mamazu Nov 11, 2025
87459cb
Removing deprecated stuff
mamazu Nov 11, 2025
d8c3c25
Fixing the tagged_iterator situation
mamazu Nov 11, 2025
32ff0e9
Stuff
mamazu Nov 12, 2025
72c5e54
More fixes
mamazu Nov 12, 2025
2b3384e
Merge remote-tracking branch 'upstream/2.5' into sulu3.0-compat
mamazu Nov 12, 2025
48de412
Removing unsupported routing config
mamazu Nov 12, 2025
a38bb59
Fixing locale issues
mamazu Nov 12, 2025
0ce8a32
Using the new content structur
mamazu Nov 12, 2025
4363d45
Stuff
mamazu Dec 6, 2025
d5a9ec5
Tagging the form loader and removing the routing bundle
mamazu Dec 7, 2025
6c77754
First semi working version
mamazu Dec 8, 2025
860188d
Fixing the frontend rendering
mamazu Dec 8, 2025
795189b
Fixing more stuff
mamazu Dec 8, 2025
d3c32cc
Fixing view data
mamazu Dec 8, 2025
c6a48fc
Moving the configs to php
mamazu Dec 10, 2025
aaac3d6
Fixing property loading
mamazu Dec 10, 2025
566c291
Fixing the service loading
mamazu Dec 10, 2025
d5ff08f
Fixing service stuff
mamazu Dec 10, 2025
93a393e
Fixing pipeline
mamazu Dec 10, 2025
18570b7
Fixing the missing parameters
mamazu Dec 10, 2025
bff4919
Using snapshot testing for the form metadata
mamazu Dec 10, 2025
8092e5a
Removing default helper config
mamazu Dec 10, 2025
fe5f745
Article Title provider
mamazu Dec 10, 2025
41de60b
Removing redundant kernel
mamazu Dec 10, 2025
46f0979
Fixing typo
mamazu Dec 10, 2025
e944ab1
Using the correct service id
mamazu Dec 10, 2025
6ec2126
Fixing services
mamazu Dec 10, 2025
99d79cf
Fixing type errors
mamazu Dec 11, 2025
a532df3
Fixing more tests
mamazu Dec 11, 2025
1463d40
Fixing types
mamazu Dec 11, 2025
72ff20f
Reverting AbstractType
mamazu Dec 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,6 @@ jobs:
fail-fast: false
matrix:
include:
- php-version: '7.2'
database: postgres
dependency-versions: 'lowest'
tools: 'composer:v2'
phpunit-config: 'phpunit-9.xml.dist'
env:
SYMFONY_DEPRECATIONS_HELPER: disabled
DATABASE_URL: postgres://postgres:postgres@127.0.0.1/sulu_form_test?serverVersion=12.5
DATABASE_CHARSET: UTF8
DATABASE_COLLATE:

- php-version: '7.4'
database: mysql
dependency-versions: 'highest'
tools: 'composer:v2'
phpunit-config: 'phpunit-9.xml.dist'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://root:root@127.0.0.1/sulu_form_test?serverVersion=5.7
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci

- php-version: '8.0'
database: mysql
dependency-versions: 'highest'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://root:root@127.0.0.1/sulu_form_test?serverVersion=5.7
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci

- php-version: '8.1'
database: mysql
dependency-versions: 'highest'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://root:root@127.0.0.1/sulu_form_test?serverVersion=5.7
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci

- php-version: '8.2'
database: postgres
dependency-versions: 'highest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
* with this source code in the file LICENSE.
*/

namespace Sulu\Bundle\FormBundle\Controller;
namespace Sulu\Bundle\FormBundle\Admin\Controller;

use Doctrine\ORM\EntityManager;
use FOS\RestBundle\Controller\ControllerTrait;
use FOS\RestBundle\Routing\ClassResourceInterface;
use FOS\RestBundle\View\ViewHandler;
use Sulu\Bundle\FormBundle\Admin\ListBuilder\DynamicListFactoryInterface;
use Sulu\Bundle\FormBundle\Entity\Dynamic;
use Sulu\Bundle\FormBundle\Entity\Form;
use Sulu\Bundle\FormBundle\ListBuilder\DynamicListFactory;
use Sulu\Bundle\FormBundle\Repository\DynamicRepository;
use Sulu\Bundle\FormBundle\Repository\FormRepository;
use Sulu\Bundle\MediaBundle\Media\Exception\MediaNotFoundException;
Expand All @@ -30,54 +29,18 @@
/**
* Controller to create dynamic form entries list.
*/
class DynamicController implements ClassResourceInterface
class DynamicController
{
use ControllerTrait;

/**
* @var DynamicRepository
*/
private $dynamicRepository;

/**
* @var DynamicListFactory
*/
private $dynamicListFactory;

/**
* @var MediaManagerInterface
*/
private $mediaManager;

/**
* @var EntityManager
*/
private $entityManager;

/**
* @var FormRepository
*/
private $formRepository;

/**
* @var ViewHandler
*/
private $viewHandler;

public function __construct(
DynamicRepository $dynamicRepository,
DynamicListFactory $dynamicListFactory,
MediaManagerInterface $mediaManager,
EntityManager $entityManager,
FormRepository $formRepository,
ViewHandler $viewHandler
private DynamicRepository $dynamicRepository,
private DynamicListFactoryInterface $dynamicListFactory,
private MediaManagerInterface $mediaManager,
private EntityManager $entityManager,
private FormRepository $formRepository,
private ViewHandler $viewHandler
) {
$this->dynamicRepository = $dynamicRepository;
$this->dynamicListFactory = $dynamicListFactory;
$this->mediaManager = $mediaManager;
$this->entityManager = $entityManager;
$this->formRepository = $formRepository;
$this->viewHandler = $viewHandler;
}

/**
Expand All @@ -90,12 +53,10 @@ public function cgetAction(Request $request): Response
$page = (int) $request->query->getInt('page', 1);
$limit = (int) $request->query->getInt('limit');
$offset = (int) (($page - 1) * $limit);
/** @var string $view */
$view = $request->query->get('view', 'default');
/** @var string $sortOrder */
$sortOrder = $request->query->get('sortOrder', 'asc');
/** @var string $sortBy */
$sortBy = $request->query->get('sortBy', 'created');

$view = $request->query->getString('view', 'default');
$sortOrder = $request->query->getString('sortOrder', 'asc');
$sortBy = $request->query->getString('sortBy', 'created');

$entries = $this->dynamicRepository->findByFilters(
$filters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
* with this source code in the file LICENSE.
*/

namespace Sulu\Bundle\FormBundle\Controller;
namespace Sulu\Bundle\FormBundle\Admin\Controller;

use FOS\RestBundle\Routing\ClassResourceInterface;
use FOS\RestBundle\View\ViewHandlerInterface;
use Sulu\Bundle\FormBundle\Admin\FormAdmin;
use Sulu\Bundle\FormBundle\Entity\Form;
Expand All @@ -21,58 +20,28 @@
use Sulu\Component\Rest\Exception\RestException;
use Sulu\Component\Rest\ListBuilder\AbstractListBuilder;
use Sulu\Component\Rest\ListBuilder\Doctrine\DoctrineListBuilderFactoryInterface;
use Sulu\Component\Rest\ListBuilder\ListRepresentation;
use Sulu\Component\Rest\ListBuilder\ListRestHelperInterface;
use Sulu\Component\Rest\ListBuilder\Metadata\FieldDescriptorFactoryInterface;
use Sulu\Component\Rest\ListBuilder\PaginatedRepresentation;
use Sulu\Component\Rest\RestHelperInterface;
use Sulu\Component\Security\SecuredControllerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;

class FormController extends AbstractRestController implements ClassResourceInterface, SecuredControllerInterface
class FormController extends AbstractRestController implements SecuredControllerInterface
{
/**
* @var FormManager
*/
private $formManager;

/**
* @var RestHelperInterface
*/
private $restHelper;

/**
* @var DoctrineListBuilderFactoryInterface
*/
private $factory;

/**
* @var FieldDescriptorFactoryInterface
*/
private $fieldDescriptorFactory;

/**
* @var ListRestHelperInterface
*/
private $listRestHelper;

public function __construct(
ViewHandlerInterface $viewHandler,
TokenStorageInterface $tokenStorage,
FormManager $formManager,
RestHelperInterface $restHelper,
DoctrineListBuilderFactoryInterface $factory,
FieldDescriptorFactoryInterface $fieldDescriptorFactory,
ListRestHelperInterface $listRestHelper
private FormManager $formManager,
private RestHelperInterface $restHelper,
private DoctrineListBuilderFactoryInterface $factory,
private FieldDescriptorFactoryInterface $fieldDescriptorFactory,
private ListRestHelperInterface $listRestHelper
) {
parent::__construct($viewHandler, $tokenStorage);
$this->formManager = $formManager;
$this->restHelper = $restHelper;
$this->factory = $factory;
$this->fieldDescriptorFactory = $fieldDescriptorFactory;
$this->listRestHelper = $listRestHelper;
}

/**
Expand Down Expand Up @@ -102,7 +71,7 @@ public function cgetAction(Request $request): Response
$filters = $this->getFilters($request);

// flatted entities
if ('true' === $request->get('flat')) {
if ($request->query->getBoolean('flat')) {
// get model class
/** @var AbstractListBuilder $listBuilder */
$listBuilder = $this->factory->create($this->getModelClass());
Expand Down Expand Up @@ -142,11 +111,9 @@ public function cgetAction(Request $request): Response
}

// create list representation
$representation = new ListRepresentation(
$representation = new PaginatedRepresentation(
$list,
$this->getListName(),
$request->get('_route'),
$request->query->all(),
$page,
$limit,
$total
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
* with this source code in the file LICENSE.
*/

namespace Sulu\Bundle\FormBundle\Controller;
namespace Sulu\Bundle\FormBundle\Admin\Controller;

use FOS\RestBundle\Routing\ClassResourceInterface;
use FOS\RestBundle\View\ViewHandlerInterface;
use Sulu\Bundle\FormBundle\Provider\ListProviderRegistry;
use Sulu\Component\Rest\AbstractRestController;
use Sulu\Component\Rest\ListBuilder\Doctrine\DoctrineListBuilderFactoryInterface;
use Sulu\Component\Rest\ListBuilder\ListRepresentation;
use Sulu\Component\Rest\ListBuilder\PaginatedRepresentation;
use Sulu\Component\Rest\RestHelperInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -25,32 +25,14 @@

class ListController extends AbstractRestController implements ClassResourceInterface
{
/**
* @var RestHelperInterface
*/
private $restHelper;

/**
* @var DoctrineListBuilderFactoryInterface
*/
private $listBuilderFactory;

/**
* @var ListProviderRegistry
*/
private $providerRegistry;

public function __construct(
ViewHandlerInterface $viewHandler,
TokenStorageInterface $tokenStorage,
RestHelperInterface $restHelper,
DoctrineListBuilderFactoryInterface $listBuilderFactory,
ListProviderRegistry $providerRegistry
private RestHelperInterface $restHelper,
private DoctrineListBuilderFactoryInterface $listBuilderFactory,
private ListProviderRegistry $providerRegistry
) {
parent::__construct($viewHandler, $tokenStorage);
$this->restHelper = $restHelper;
$this->listBuilderFactory = $listBuilderFactory;
$this->providerRegistry = $providerRegistry;
}

public function cgetFieldsAction(Request $request): Response
Expand Down Expand Up @@ -109,11 +91,9 @@ public function cgetAction(Request $request): Response
$limit = $listBuilder->getLimit();

// create list representation
$representation = new ListRepresentation(
$representation = new PaginatedRepresentation(
$list,
'entries',
$request->get('_route'),
$request->query->all(),
$page,
$limit,
$total
Expand Down
23 changes: 4 additions & 19 deletions Admin/DynamicListAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,13 @@

class DynamicListAdmin extends Admin
{
public static function getPriority(): int
{
return -1024;
}

/**
* @var ViewBuilderFactoryInterface
*/
private $viewBuilderFactory;

/**
* @var mixed[]
*/
private $config;

/**
* @param mixed[] $config
*/
public function __construct(ViewBuilderFactoryInterface $viewBuilderFactory, array $config)
{
$this->viewBuilderFactory = $viewBuilderFactory;
$this->config = $config;
public function __construct(
private ViewBuilderFactoryInterface $viewBuilderFactory,
private array $config,
) {
}

public function configureViews(ViewCollection $viewCollection): void
Expand Down
27 changes: 3 additions & 24 deletions Admin/FormAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,11 @@ class FormAdmin extends Admin
public const EDIT_FORM_VIEW = 'sulu_form.edit_form';
public const EDIT_FORM_DETAILS_VIEW = 'sulu_form.edit_form.details';

/**
* @var SecurityCheckerInterface
*/
private $securityChecker;

/**
* @var ViewBuilderFactoryInterface
*/
private $viewBuilderFactory;

/**
* @var WebspaceManagerInterface
*/
private $webspaceManager;

/**
* FormAdmin constructor.
*/
public function __construct(
SecurityCheckerInterface $securityChecker,
ViewBuilderFactoryInterface $viewBuilderFactory,
WebspaceManagerInterface $webspaceManager
private SecurityCheckerInterface $securityChecker,
private ViewBuilderFactoryInterface $viewBuilderFactory,
private WebspaceManagerInterface $webspaceManager
) {
$this->securityChecker = $securityChecker;
$this->viewBuilderFactory = $viewBuilderFactory;
$this->webspaceManager = $webspaceManager;
}

public function configureNavigationItems(NavigationItemCollection $navigationItemCollection): void
Expand Down
Loading
Loading