-
Notifications
You must be signed in to change notification settings - Fork 79
Sulu3.0 integration (clean up version) #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.5
Are you sure you want to change the base?
Conversation
21666ed to
2b3384e
Compare
|
@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? |
aba3107 to
860188d
Compare
| return ContentView::create(null, ['id' => null, ...$params]); | ||
| } | ||
|
|
||
| if (!array_key_exists('resourceKey', $params)) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
8dc0fbc to
b714b45
Compare
b714b45 to
ccc3e7f
Compare
ccc3e7f to
c6a48fc
Compare
e68bac6 to
566c291
Compare
c552416 to
bff4919
Compare
3eb00e1 to
6ec2126
Compare
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
BC Breaks/Deprecations
Describe BC breaks/deprecations here. (remove this section if not needed)
To Do