-
Notifications
You must be signed in to change notification settings - Fork 78
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
createCollection for tree strategy not working #354
Comments
Are you using the form on a Sulu What is returned here? https://github.com/sulu/SuluFormBundle/blob/6c424abf8966d081f2366ac2af8e5f4b840a9aef/TitleProvider/StructureTitleProvider.php#LL38C9-L38C94 What values do exist in the
The structure is the |
I am currently using this on a Sulu https://github.com/sulu/SuluFormBundle/blob/6c424abf8966d081f2366ac2af8e5f4b840a9aef/TitleProvider/StructureTitleProvider.php#LL38C9-L38C94 returns
I did notice that the hash after the route name is the same as the one inside |
Where does the Is the SuluFormBundle/Content/Types/SingleFormSelection.php Lines 110 to 116 in 6c424ab
|
It does not seem to reach the |
Sorry this would be correct code part in the SingleFormSelection: SuluFormBundle/Content/Types/SingleFormSelection.php Lines 77 to 83 in 6c424ab
I think the problem here is that it comes from a default snippet and can so not correctly detect the title. Not sure how we should behave in this situation, as the saved data seems not connected to the page or is it. What typeId is send as post with the form the snippet uuid or the page uuid? Also not sure what the correct behaviour here should be, if the data should be part of that snippet or part of a page. |
Inside the What I tried to achieve with my approach is to have a dynamic form reusable. I want the content manager to be able to create a form that's applied to all templates of a certain type. The reason is that the form configuration is the same, the only difference is the origin being tracked. I'm not sure that my approach is the ideal or correct one. |
Any advice on how I would be able to make one form, that's reusable on multiple pages? I would like to have the end user define the different form fields in the admin site. It should also keep track of what page it's submitted on. Is this possible with the dynamic forms? Or can I only achieve this by using a custom Symfony Form instead, taking away the dynamical part that the bundle provides? |
Actual Behavior
When uploading a file using the "attachment" field, a 500 occurs when submitting the form.
When using the collection strategy "tree", I am getting a 500 error stating that
$title
needs to be string, but null is given atCollectionTreeStrategy.php
at line 86.After further investigation, I noticed that in the collection strategy at line 60, this variable is supposedly being set. However, this is null in my case.
Since the title is null but is required for the createCollection method, I'm wondering if I'm missing something, or if this is a bug (for what I'll be creating an issue if this is the case).
When looking inside the
getTitle
method, I noticed that of the check returning null,(!$structure instanceof StructureInterface || $structure->getUuid() !== $typeId
at line 38 in the StructureTitleProvider seems to fail on the$structure->getUuid() !== $typeId
check.Since I'm unsure what the logic behind the whole structure is, I'm unsure if this is a bug, or if I'm missing something in my code to prevent this error.
Expected Behavior
The form to submit and a collection to be made for the form uploads.
Steps to Reproduce
Setting the sulu form collection strategy to "tree". Adding an attachment type to the form, loading the form on a template and trying to submit by uploading a file.
The text was updated successfully, but these errors were encountered: