Skip to content

Conversation

@mamazu
Copy link
Contributor

@mamazu mamazu commented Nov 11, 2025

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets fixes #issuenum
Related issues/PRs #issuenum
License MIT

What's in this PR?

Explain the contents of the PR.

Why?

Which problem does the PR fix? (remove this section if you linked an issue above)

Example Usage

// If you added new features, show examples of how to use them here
// (remove this section if not a new feature)

$foo = new Foo();

// Now we can do
$foo->doSomething();

BC Breaks/Deprecations

Describe BC breaks/deprecations here. (remove this section if not needed)

To Do

  • Create documentation

@mamazu
Copy link
Contributor Author

mamazu commented Nov 12, 2025

@alexander-schranz Since I have no idea how the new content structure works. Can you check out the last commit and see if that is the correct implementation?

@Prokyonn Prokyonn mentioned this pull request Nov 24, 2025
2 tasks
return ContentView::create(null, ['id' => null, ...$params]);
}

if (!array_key_exists('resourceKey', $params)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the resourceKey here? I think we can omit this exception, as the resourceKey for the reference is always Form::RESOURCE_KEY

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand this is the type of content into which you're embedding the form (if it's an article, a snippet). Because the form needs to know how to get the title of the content it's being rendered on. (see implementation of the TitleProviderInterface

}

/** @var string $resourceLoaderKey */
$resourceLoaderKey = $params['resourceLoaderKey'] ?? FormSelectionResourceLoader::getKey();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we usually used resourceLoader without the key

Form::RESOURCE_KEY,
[
'id' => $data,
'entity' => $this->formRepository->find((int)$data)?->serializeForLocale($locale),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm this is a design break, as we should not use the repository in the property resolver.
But I don't think we have currently another way to adjust the view array

use Sulu\Content\Application\ResourceLoader\Loader\ResourceLoaderInterface;
use Symfony\Component\Form\FormView;

final class FormSelectionResourceLoader implements ResourceLoaderInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be only FormResourceLoader the resourceloader is independent of the propertyresolver and therefore should be used for both single and multi selections.

@mamazu mamazu changed the title DRAFT: Sulu3.0 compat Sulu3.0 integration (clean up version) Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants