-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Can't use datetime field type as editable #6144
Can't use datetime field type as editable #6144
Conversation
7a52d18
to
ad29f81
Compare
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.
Can we update the available type in the doc with the TemplateRegistry
constant instead ?
Also I would prefer to NOT add the deprecated type in the documentation,
- text
- smallint
- bigint
- decimal (float should be preferred)
@VincentLanglet i did not want to remove supported types, although they are deprecated. But if you insist, i will remove them. |
The deprecated type are already removed from some part of the documentation. I don't think it's a good idea to keep the doc about the deprecated type, because we don't want developers to use them. Plus, we'll certainly forget to update the doc in the next major if we don't remove them now. |
ad29f81
to
307a245
Compare
Thanks for the update @peter-gribanov I that don't bother you, can you also replace same for time, datetime, percent, ... Let's promote the use of the new constant ! |
I updated the PR description. If something is not clear, please ask. |
307a245
to
8261ac2
Compare
I update documentation. |
Thanks ! By looking at the X-editable repository, I discover that this is not maintained anymore This will especially be a blocking point when we'll want to support boostrap 4. |
Yes. I have seen that. This project has not been updated for more than a year. I do not know X-editable. You may have to abandon the live-edit function. |
I created an issue for this discussion. Feel free to add any information which can help :) |
5e2daf4
8261ac2
to
5e2daf4
Compare
@xleliberty can you comment this PR? Did editing datetime work for you? |
Could you please rebase your PR and fix merge conflicts? |
Hi sorry, i didn't see this message before. sorry |
@xleliberty this problem is not in Symfony and not in Sonata. This problem is that the X-editable Maybe you are using a different version of |
5e2daf4
to
02bb8bd
Compare
Can we make a PR on eonasdan-bootstrap-datetimepicker ?
Can't we add the missing line in our assets ? |
I don't think they would want to restore compatibility with a project that is no longer supported.
Not so simple. Also required
It looks like you need to rewrite the datetimepicker implementation in the X-editable. If you have the time and desire, you can always do it. I will not do it. |
Could you please rebase your PR and fix merge conflicts? |
correct documentation add a time field options in documentation remove deprecated field types from documentation datetime field type is not editable use constants in documentation use constants for determinate a field type
02bb8bd
to
77dc339
Compare
Thank you @peter-gribanov |
allow use data_transformer in SetObjectFieldValueAction create BooleanToStringTransformer for allows to use non-strings update SetObjectFieldValueActionTest use yoda conditions fix errors in HelperControllerTest test BooleanToStringTransformer allow override transformers for 'date', 'boolean' and 'choice' field types mark BooleanToStringTransformer and BooleanToStringTransformer classes as final add example of using the data_transformer option in docs add full docs about Symfony Data Transformers optimize resolve Data Transformer fix docs create DataTransformerResolver service add type hint for BooleanToStringTransformer::$trueValue allow add a custom global transformers field type should be a string correct default value for $globalCustomTransformers correct test DataTransformerResolverTest::testAddCustomGlobalTransformer() add BC support usage of DataTransformerResolver Update tests/Action/SetObjectFieldValueActionTest.php Update tests/Action/SetObjectFieldValueActionTest.php Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php Update tests/Form/DataTransformerResolverTest.php Update tests/Form/DataTransformerResolverTest.php Update src/Action/SetObjectFieldValueAction.php change "entity" word to "model" in documentations change deprecated error message add datetime in editable date form types correct test transform datetime and date form types test DateTime object in assertSame() fix typo restore getTemplate() return value in SetObjectFieldValueActionTest use Yoda conditions lazy-load predefined data transformers add DataTransformerResolverInterface use constants for determinate a field type test laze-load data transformers test usage DataTransformerResolver::addCustomGlobalTransformer() create simple function in DataTransformerResolverTest Process deprecation of FieldDescriptionInterface::getTargetEntity() Use FieldDescriptionInterface::getTargetModel if exists sonata-project#6208 change usage getTargetEntity() -> getTargetModel() in DataTransformerResolverTest merge changes from PR sonata-project#6167 register BooleanToStringTransformer as a service merge changes from PR sonata-project#6144
allow use data_transformer in SetObjectFieldValueAction create BooleanToStringTransformer for allows to use non-strings update SetObjectFieldValueActionTest use yoda conditions fix errors in HelperControllerTest test BooleanToStringTransformer allow override transformers for 'date', 'boolean' and 'choice' field types mark BooleanToStringTransformer and BooleanToStringTransformer classes as final add example of using the data_transformer option in docs add full docs about Symfony Data Transformers optimize resolve Data Transformer fix docs create DataTransformerResolver service add type hint for BooleanToStringTransformer::$trueValue allow add a custom global transformers field type should be a string correct default value for $globalCustomTransformers correct test DataTransformerResolverTest::testAddCustomGlobalTransformer() add BC support usage of DataTransformerResolver Update tests/Action/SetObjectFieldValueActionTest.php Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php Update tests/Form/DataTransformerResolverTest.php Update src/Action/SetObjectFieldValueAction.php change "entity" word to "model" in documentations change deprecated error message add datetime in editable date form types correct test transform datetime and date form types test DateTime object in assertSame() fix typo restore getTemplate() return value in SetObjectFieldValueActionTest use Yoda conditions lazy-load predefined data transformers add DataTransformerResolverInterface use constants for determinate a field type test laze-load data transformers test usage DataTransformerResolver::addCustomGlobalTransformer() create simple function in DataTransformerResolverTest Process deprecation of FieldDescriptionInterface::getTargetEntity() Use FieldDescriptionInterface::getTargetModel if exists sonata-project#6208 change usage getTargetEntity() -> getTargetModel() in DataTransformerResolverTest merge changes from PR sonata-project#6167 register BooleanToStringTransformer as a service merge changes from PR sonata-project#6144
allow use data_transformer in SetObjectFieldValueAction create BooleanToStringTransformer for allows to use non-strings update SetObjectFieldValueActionTest use yoda conditions fix errors in HelperControllerTest test BooleanToStringTransformer allow override transformers for 'date', 'boolean' and 'choice' field types mark BooleanToStringTransformer and BooleanToStringTransformer classes as final add example of using the data_transformer option in docs add full docs about Symfony Data Transformers optimize resolve Data Transformer fix docs create DataTransformerResolver service add type hint for BooleanToStringTransformer::$trueValue allow add a custom global transformers field type should be a string correct default value for $globalCustomTransformers correct test DataTransformerResolverTest::testAddCustomGlobalTransformer() add BC support usage of DataTransformerResolver Update tests/Action/SetObjectFieldValueActionTest.php Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php Update tests/Form/DataTransformerResolverTest.php Update src/Action/SetObjectFieldValueAction.php change "entity" word to "model" in documentations change deprecated error message add datetime in editable date form types correct test transform datetime and date form types test DateTime object in assertSame() fix typo restore getTemplate() return value in SetObjectFieldValueActionTest use Yoda conditions lazy-load predefined data transformers add DataTransformerResolverInterface use constants for determinate a field type test laze-load data transformers test usage DataTransformerResolver::addCustomGlobalTransformer() create simple function in DataTransformerResolverTest Process deprecation of FieldDescriptionInterface::getTargetEntity() Use FieldDescriptionInterface::getTargetModel if exists sonata-project#6208 change usage getTargetEntity() -> getTargetModel() in DataTransformerResolverTest merge changes from PR sonata-project#6167 register BooleanToStringTransformer as a service merge changes from PR sonata-project#6144 Move internal configuration to PHP sonata-project#6284
allow use data_transformer in SetObjectFieldValueAction create BooleanToStringTransformer for allows to use non-strings update SetObjectFieldValueActionTest use yoda conditions fix errors in HelperControllerTest test BooleanToStringTransformer allow override transformers for 'date', 'boolean' and 'choice' field types mark BooleanToStringTransformer and BooleanToStringTransformer classes as final add example of using the data_transformer option in docs add full docs about Symfony Data Transformers optimize resolve Data Transformer fix docs create DataTransformerResolver service add type hint for BooleanToStringTransformer::$trueValue allow add a custom global transformers field type should be a string correct default value for $globalCustomTransformers correct test DataTransformerResolverTest::testAddCustomGlobalTransformer() add BC support usage of DataTransformerResolver Update tests/Action/SetObjectFieldValueActionTest.php Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php Update tests/Form/DataTransformerResolverTest.php Update src/Action/SetObjectFieldValueAction.php change "entity" word to "model" in documentations change deprecated error message add datetime in editable date form types correct test transform datetime and date form types test DateTime object in assertSame() fix typo restore getTemplate() return value in SetObjectFieldValueActionTest use Yoda conditions lazy-load predefined data transformers add DataTransformerResolverInterface use constants for determinate a field type test laze-load data transformers test usage DataTransformerResolver::addCustomGlobalTransformer() create simple function in DataTransformerResolverTest Process deprecation of FieldDescriptionInterface::getTargetEntity() Use FieldDescriptionInterface::getTargetModel if exists sonata-project#6208 change usage getTargetEntity() -> getTargetModel() in DataTransformerResolverTest merge changes from PR sonata-project#6167 register BooleanToStringTransformer as a service merge changes from PR sonata-project#6144 Move internal configuration to PHP sonata-project#6284
allow use data_transformer in SetObjectFieldValueAction create BooleanToStringTransformer for allows to use non-strings update SetObjectFieldValueActionTest use yoda conditions fix errors in HelperControllerTest test BooleanToStringTransformer allow override transformers for 'date', 'boolean' and 'choice' field types mark BooleanToStringTransformer and BooleanToStringTransformer classes as final add example of using the data_transformer option in docs add full docs about Symfony Data Transformers optimize resolve Data Transformer fix docs create DataTransformerResolver service add type hint for BooleanToStringTransformer::$trueValue allow add a custom global transformers field type should be a string correct default value for $globalCustomTransformers correct test DataTransformerResolverTest::testAddCustomGlobalTransformer() add BC support usage of DataTransformerResolver Update tests/Action/SetObjectFieldValueActionTest.php Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php Update tests/Form/DataTransformerResolverTest.php Update src/Action/SetObjectFieldValueAction.php change "entity" word to "model" in documentations change deprecated error message add datetime in editable date form types correct test transform datetime and date form types test DateTime object in assertSame() fix typo restore getTemplate() return value in SetObjectFieldValueActionTest use Yoda conditions lazy-load predefined data transformers add DataTransformerResolverInterface use constants for determinate a field type test laze-load data transformers test usage DataTransformerResolver::addCustomGlobalTransformer() create simple function in DataTransformerResolverTest Process deprecation of FieldDescriptionInterface::getTargetEntity() Use FieldDescriptionInterface::getTargetModel if exists sonata-project#6208 change usage getTargetEntity() -> getTargetModel() in DataTransformerResolverTest merge changes from PR sonata-project#6167 register BooleanToStringTransformer as a service merge changes from PR sonata-project#6144 merge changes from PR sonata-project#6284 compare date with time in DataTransformerResolverTest
allow use data_transformer in SetObjectFieldValueAction create BooleanToStringTransformer for allows to use non-strings update SetObjectFieldValueActionTest use yoda conditions fix errors in HelperControllerTest test BooleanToStringTransformer allow override transformers for 'date', 'boolean' and 'choice' field types mark BooleanToStringTransformer and BooleanToStringTransformer classes as final add example of using the data_transformer option in docs add full docs about Symfony Data Transformers optimize resolve Data Transformer fix docs create DataTransformerResolver service add type hint for BooleanToStringTransformer::$trueValue allow add a custom global transformers field type should be a string correct default value for $globalCustomTransformers correct test DataTransformerResolverTest::testAddCustomGlobalTransformer() add BC support usage of DataTransformerResolver Update tests/Action/SetObjectFieldValueActionTest.php Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php Update tests/Form/DataTransformerResolverTest.php Update src/Action/SetObjectFieldValueAction.php change "entity" word to "model" in documentations change deprecated error message add datetime in editable date form types correct test transform datetime and date form types test DateTime object in assertSame() fix typo restore getTemplate() return value in SetObjectFieldValueActionTest use Yoda conditions lazy-load predefined data transformers add DataTransformerResolverInterface use constants for determinate a field type test laze-load data transformers test usage DataTransformerResolver::addCustomGlobalTransformer() create simple function in DataTransformerResolverTest Process deprecation of FieldDescriptionInterface::getTargetEntity() Use FieldDescriptionInterface::getTargetModel if exists #6208 change usage getTargetEntity() -> getTargetModel() in DataTransformerResolverTest merge changes from PR #6167 register BooleanToStringTransformer as a service merge changes from PR #6144 merge changes from PR #6284 compare date with time in DataTransformerResolverTest
Subject
In PR #6071 added hendleing adatetime
field type toSetObjectFieldValueAction
, but this type is not really editable.Unfortunately, i want to say that it is not possible to use the datetime type as editable due to the conflict of dependencies in X-editable. Attempting to use the datetime type as editable will result in an error in JavaScript at this line.
Attempting to update the X-editable code to the latest version (1.5.1 => 1.5.3) will fail. This code has not changed in the original library.
Problem due to dependency:
The link indicates a project (
bootstrap-datetime-picker
) that is deprecated in favour of eonasdan-bootstrap-datetimepicker. Theeonasdan-bootstrap-datetimepicker
is already used in the SonataCoreBundle, but it is not compatible with X-editable.For X-editable, the old version of the library is needed because the next line is there. X-editable breaks because variable
$.fn.datetimepicker.DPGlobal
is not defined.Connecting both libraries is not possible. They will conflict.
I also updated the documentation because it is outdated.
Changelog