neos / form Goto Github PK
View Code? Open in Web Editor NEWFlow Form Framework
Home Page: https://flow-form-framework.readthedocs.org/en/latest/
License: MIT License
Flow Form Framework
Home Page: https://flow-form-framework.readthedocs.org/en/latest/
License: MIT License
Attributes like type
and inputmode
can't currently be used with the default (Fluid-based) rendering
Even though a \Neos\Form\Core\Model\Page
is an instance of \Neos\Form\Core\Model\AbstractSection
(thus implementing the onSubmit()
function) the callback is only invoked for form elements.
It would be very useful to have that callback on the page level, too. For example in order to post-process form values and/or tweak the form definition upon submitted values.
The FormState
should be final
, according to
form/Classes/Core/Runtime/FormState.php
Line 20 in 7ebd9ec
It used to be possible to get the form values in AbstractFormElement::onSubmit()
. But $formRuntime->getFormState()->getFormValues()
is empty since version 5.3.0.
$formRuntime->getFormState()->getFormValues()
in onSubmit
array(1)
'password' (8) => 'aaaa' (4)
array(empty)
neos/form 5.3.0
Due to a void
return type that was introduced with the overhauled EmailFinisher
with #91 the 4.3 branch is currently not compatible with PHP versions below 7.1
This line in the EmailFinisher class does not ensure that the required Swiftmailer class is actually available (and causes a fatal error if you don't have Swiftmailer installed):
$mail = new \TYPO3\SwiftMailer\Message();
I suggest to either include Swiftmailer as dependency in composer.json or to check for installed Swiftmailer and throw an informative exception instead.
The commit from #155 has the consequence that at least for radio buttons and file uploads the marking as mandatory field does not work anymore. Both elements have no request arguments if nothing was selected or uploaded, so the condition applies to these elements. As a result, the elements are not validated afterwards.
If you remove the condition, the validation works again. But this is surely not desired, so I looked a little further and if you move the line $registerPropertyPaths($element->getIdentifier());
to the beginning of the loop, the validation works as well. If I'm looking at this correctly after the short time, that should both solve the problem without breaking the change from #155.
Using a DatePicker field in a multi-page form throws an exception, when you try to re-render the field with a value set.
E.g.
Exception
Could not convert target type “DateTime”: No converter found which can be used to convert from “__PHP_Incomplete_Class” or “object” to “DateTime”.
The unserialize of the form state causes this, because it is restricted to FormState
class, so the DateTime
object is ignored and handled as incomplete class.
This behavior was introduced by this changes:
c186327
ee593c2
Affected: Neos.Form >= 5.0
See also: https://discuss.neos.io/t/datetime-conversion-in-form/5007
The listForms
method in YamlPersistenceManager
triggers warning when the index is not found in the array containing settings from a YAML file.
In our case ContactForm.yaml
is located in Packages/Sites/WE.SitePackage/Configuration
which contains other non form setting YAML files as well.
When the code tries to access $form['identifier']
on line 105 it causes index not found warning what will be displayed in the Neos backend.
Suggested fix: add type check before access the $form
array:
if (!key_exists('type', $form) && $form['type'] === 'TYPO3.Form:Form'){
$forms[] = array(
'identifier' => $form['identifier'],
'name' => isset($form['label']) ? $form['label'] : $form['identifier'],
'persistenceIdentifier' => $persistenceIdentifier
);
}
In Neos 4.1.7 I am getting the error that maxlength is no declared argument in TextAreaViewHelper.
Jira issue originally created by user @bwaidelich:
See https://discuss.neos.io/t/make-typo3-form-package-localizable/291 for some thoughts on this
Jira-URL: https://jira.neos.io/browse/NEOS-1401
Although the license is mentioned in the composer.json, maybe the file should be added anyway :)
After migrating to the Neos namespace it will be great with a tag/release that can be referred to in the composer.json file (perhaps alongside the release of Flow 4.0)
I am not sure what the problem with the datepicker in my project is, but the point is that it doesn't work. Please look at my code. Am I missing something?
CST-DatePicker.txt
It would be great, if you could pass data e.g. from your site node to the form and include them in a e.g. in a hidden form element.
Example use case
Registration
Passing details of an event so that you can use the form to register and predefine information e.g. event name, date, ... which will also be available in the finisher
Can you create a new release of this package?
Since there were for a longer time no new changes were added and there are changes in the master branch that are not in the latest release it would be really helpfull if you create a new release.
typo3/flow: ^3.1
typo3/form: ^2.0
I followed the steps
In the frontend i get Catchable Fatal Error: Argument 1 passed to My\Package\Forms\TestForm_Original::build() must be of the type array, null given
so there must be something more to do
Also the links in http://flow-form-framework.readthedocs.org/en/latest/quickstart.html
are broken
The RenderValuesViewHelper depends on view->getFormRuntime() which is not present in the StandaloneView.
It would be better to pass the runtime by parameter (could be optional to not be a breaking change).
This way it would be usable in EmailFinishers
Hello,
since the Recipientaddress may be an array of addresses the finisher checks, if the recipientName is an empty string with type check.
if (is_array($recipientAddress) && $recipientName !== '') { throw new FinisherException('The option "recipientName" cannot be used with multiple recipients in the EmailFinisher.', 1483365977); }
Since the E-Mailfinisher can be used with configured values from a yaml file, the recipientName will be transmitted as null when it is not set.
null !== ''
will return true and cause in a false validated recipientName so it's not possible to set recipientAddresses as an array.
The ConfirmationFinisher
replaces placeholders in the form {someFieldName}
.
The EmailFinisher
expects the form values to be prefixed with formValues.
, e.g. {formValues.someFieldName}
.
This feature suggests to make form Values directly accessible as view variables in the EmailFinisher
, too.
Note: The formValues.*
format should still be supported to ensure greater backwards compatibility
Currently files uploaded with the FileUpload
Form Element always end up in the persistent
resource collection.
For several reasons it would be nice to be able to specify a custom resource collection for the uploaded resources
Nested exception:
syntax error, unexpected ','
Type: ParseError
File: Packages/Application/Neos.Form/Classes/Finishers/RedirectFinisher.php
Line: 79
#93 introduced return types for some classes leading to a couple of issues, for example
neos/form-builder#64 and neos/form-builder#65
One of those was fixed with #111 but not released yet.
See
Caching of a FormDefinition
looses validators, since the ConjuncationValidator
field of a ProcessingRule
will be injected with a new instance after deserialization.
How to fix: Do not inject prototype values but create a new instance in constructor.
Jira issue originally created by user @Weissheiten:
While custom classes can be assigned to Input fields easily, this is atm not true for the navigation buttons.
The according classes are hardcoded in the navigation template.
(e.g.: to use the btn-block bootstrap style one would have to exchange the whole navigation template)
Jira-URL: https://jira.neos.io/browse/NEOS-1398
In a project I ran into this problem:
Return value of Neos\Form\ViewHelpers\Form\UploadedImageViewHelper_Original::getUploadedImage() must be an instance of Neos\Media\Domain\Model\Image or null, instance of Neos\Flow\Persistence\Doctrine\Proxies\__CG__\Neos\Media\Domain\Model\ImageVariant returned
The <form>
is rendered always withid={form.identifier}
After submitting the Form #{form.identifier}
will be added to the URL.
If the Form is somewhere on the Page, the anchor #{form.identifier}
will jump to the Form.
The Neos.Form.Builder:ConfirmationFinisher
does NOT render id={form.identifier}
around.
Because of the missing id, the Browser doesn't jump to the Confirmation Message and it maybe get lost somewhere on the page.
What about wrapping an id={form.identifier}
around the Builder:ConfirmationFinisher?
I created a PR to fix this: #129
Steps to reproduce:
Expected behavior
You get redirected to the destination node and the uri is fine.
Actual behaviour
The uri contains a double-slash.
I think the reason is found here: https://github.com/neos/form/blame/3d4bccd33df9f2e4099312543d65b6198633c6c3/Classes/Finishers/RedirectFinisher.php#L58
$request->getHttpRequest()->getBaseUri() has a trailing slash and $uri has a leading slash.
As a workaround I changed the form-builder fusion to generate an absolute uri for the redirect:
prototype(Neos.Form.Builder:NodeBasedFinisherCollection) {
itemRenderer {
redirectFinisher {
renderer {
element.options {
[email protected] = ${true}
}
}
}
}
}
But I think the code, that prepends scheme and host to the uri should be fixed in the form package.
Similar to how you override ex. TemplateRootPaths
in Views.yaml and allow a array of paths, with support for fallback, the same functionality will be great for
renderingOptions:
templatePathPattern: 'resource://{@package}/Private/Form/{@type}.html'
when you define preset.
**Today: ** If you wan't to create a preset with a different Page
than the default
preset, you have to copy all files.
**Futury: ** Add a array of paths
I don't know if it's even possible to make complete use of the TemplatePaths object of the Fluid package.
I will personally dig into this in late april (after release of project) in case it's not solved at that time.
So all feedback gathered up untill then will be appreciated.
Neos.Form 5.0.0 throws
Exception in line 340 of /…/Flow_Object_Classes/Neos_Form_Core_Runtime_FormRuntime.php: Argument 1 passed to Neos\Flow\Mvc\ActionResponse::mergeIntoParentResponse() must be an instance of Neos\Flow\Mvc\ActionResponse, instance of Neos\Flow\Mvc\ActionRequest given, called in /…/Flow_Object_Classes/Neos_Form_Core_Runtime_FormRuntime.php on line 340
Caused by
form/Classes/Core/Runtime/FormRuntime.php
Line 156 in 28d7bd1
In my usecase the FormState holds asset objects like Neos\Media\Domain\Model\Document
or Neos\Media\Domain\Model\Image
. When form is rendered with initalized formState having one of the mentioned objects, an exception is thrown:
Absorbed Exception: Notice: property_exists(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Neos\Media\Domain\Model\Document" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in .../Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Flow_Persistence_Doctrine_PersistenceManager.php line 188
Is related to #126
Reproduction
Could not convert target type "DateTime": No converter found which can be used to convert from "__PHP_Incomplete_Class" or "object" to "DateTime".
Possible solutions
// possible workaround in Neos.Form/Classes/ViewHelpers/Form/DatePickerViewHelper.php:118
$dateObject = json_decode(json_encode($date), true);
$date = $this->propertyMapper->convert($dateObject, 'DateTime');
Environment
neos/form: 5.2.0
neos/neos: 5.3.0
neos/flow: 6.3.0
php: 7.3
copied from neos/form-builder#49
If I use the new neos/swiftmailer package (^6) and try to send attachments via the e-mail finisher you get the following error:
Call to undefined method Swift_Attachment::newInstance()
From the error, it's clear that Swift_SmtpTransport class doesn't have a newInstance method.
Provide an example and/or FormElement that supports uploading of multiple files.
See https://discuss.neos.io/t/neos-form-builder-attachments/3527
Currently our CI fails because of this change:
form/Classes/Core/Runtime/FormRuntime.php
Line 489 in 51c3bf0
PHP Fatal error: Declaration of Neos\Form\Core\Runtime\FormRuntime::offset
Exists(Neos\Form\Core\Runtime\mixed $identifier): bool must be compatible with ArrayAccess::offsetExists($offset) in /Packages/Application/Neos.Form/Classes/Core/Runtime/FormRuntime.php on line 489
It was introduced in #170
But we have PHP 8.1 in our project 🤔
Based on the topic raised here
https://discuss.neos.io/t/neos-form-persist-to-a-entity-between-each-page/2444/4
I would like to know what steps that could be taken, to make it possible to process submitted value in between pages. This is, without having to create a custom page element, but simple use the shipped Neos.Form:Page
Some of the thought I've had:
What if the user go back/forth in the form a.k.a. re-processing
This should not be the task of this patch to take care of that
How can we add any created data / outcome of processing to the form
Why us onSubmit not called for Page form element
Could this be a low-hanging fruit that we can pick simply by letting onSubmit be called also on Page element?
Scenario:
I use the Form-Framework via FormBuilder inside a Neos project. We have node based form with 2 finishers:
Expected behaviour:
After submitting the form (when validation does not complain), the users gets redirected to the thankyou-document-uri.
Actual behavirour:
The redirect is working, but before it happens, the document of the form is rendered and visible for 1-2s and then the redirct happens.
Can we achive that the redirect happens without the "intermediate rendering" of the form?
At the moment it is not possible to send multipart mails with the EmailFinisher.
Jira issue originally created by user @kitsunet:
The form package creates form urls by using the current http requests url, which might not necessarily be correct if the application is used behind a proxy. Instead it should use the baseUri + the current route values to create the uri.
An example which breaks behind proxies like varnish is the Neos Setup which produces wrong Uris.
Jira-URL: https://jira.neos.io/browse/NEOS-1759
The EmailFinisher
should be able to send (uploaded) files as attachments
@Sebobo found a bug that I introduced, by running the tests.
So, let's setup testing for this beautiful project :)
Recently we had several request for manipulating form state initialization like:
Initialize the state from some third party tool like SAP or marketing automation
Restore the form state after mail verification without persisting the complete state in the state hash
Restore the form state after returning from some third party authentication process
The current action uri can get a section added (the #[section] value of a uri).
This is done by check if the argument has a value (empty string included) and with preg_replace, the value is added.
Since we get a UriInterface object, we can use the withFragment
instead, but it requires a stricter check for the section value, since it does not accept a empty string
With the namespace change the code migration TYPO3.Form-20160601101500
has not been adjusted completely, see: dfa23c6#commitcomment-21736520
As a result, it adds new TYPO3.Form.*
settings if the settings have been adjusted to the new namespace (Neos.Form.*
) already
AbstractCompositeRenderable::removeRenderable does not set the new indexes to the renderables (as moveRenderable(Before|After)
does).
So removing a page results in wrong pagination.
currently the parseOption function behaves as follows:
null
if it doesn'tthis means, assuming there is no default option, that an initial value of an empty string returns null.
however, a value containing an object accessor (e.g. {foo}
) will never return null - even if the result is empty.
from my perspective there are two issues:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.