Bug #23843

Date selector not working correctly in flexform with steps

Added by Gijs Oliemans almost 10 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-10-26
Due date:
% Done:

100%

TYPO3 Version:
4.4
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The date selector doesn't work at all when adding a new item in the backend in a plugin that uses a flexform with steps. Only existing (already saved) dates can be edited using the date selector popup.

Example flexform:

<T3DataStructure>

&lt;meta&gt;
&lt;langDisable&gt;1&lt;/langDisable&gt;
&lt;/meta&gt;
&lt;ROOT&gt;
&lt;TCEforms&gt;
&lt;sheetTitle&gt;Example&lt;/sheetTitle&gt;
&lt;/TCEforms&gt;
&lt;type&gt;array&lt;/type&gt;
&lt;el&gt;
&lt;steps type="array"&gt;
&lt;type&gt;array&lt;/type&gt;
&lt;section&gt;1&lt;/section&gt;
&lt;tx_templavoila type="array"&gt;
&lt;title&gt;Items&lt;/title&gt;
&lt;/tx_templavoila&gt;
&lt;el type="array"&gt;
&lt;items type="array"&gt;
&lt;type&gt;array&lt;/type&gt;
&lt;tx_templavoila type="array"&gt;
&lt;title&gt;Item&lt;/title&gt;
&lt;eType&gt;input&lt;/eType&gt;
&lt;/tx_templavoila&gt;
&lt;el type="array"&gt;
&lt;title&gt;
&lt;TCEforms&gt;
&lt;label&gt;Title&lt;/label&gt;
&lt;config&gt;
&lt;type&gt;input&lt;/type&gt;
&lt;size&gt;24&lt;/size&gt;
&lt;eval&gt;trim,required&lt;/eval&gt;
&lt;/config&gt;
&lt;/TCEforms&gt;
&lt;/title&gt;
&lt;date&gt;
&lt;TCEforms&gt;
&lt;label&gt;Date&lt;/label&gt;
&lt;config&gt;
&lt;type&gt;input&lt;/type&gt;
&lt;size&gt;8&lt;/size&gt;
&lt;eval&gt;date,required&lt;/eval&gt;
&lt;max&gt;20&lt;/max&gt;
&lt;checkbox&gt;1&lt;/checkbox&gt;
&lt;/config&gt;
&lt;/TCEforms&gt;
&lt;/date&gt;
&lt;/el&gt;
&lt;/items&gt;
&lt;/el&gt;
&lt;/steps&gt;
&lt;/el&gt;
&lt;/ROOT&gt;

</T3DataStructure>
(issue imported from #M16131)

Associated revisions

Revision 1c9e0b6a (diff)
Added by Stefan Rotsch over 8 years ago

[BUGFIX] Broken datepicker on unsaved flexform sections

The onClick event for opening the datepicker is attached to the
datepicker icons only once on page load. There currently is no update
method which adds the onClick event to new sections, so the datepicker
icons are without function until the form is saved.

Related to this, IDs of input fields are not unique when adding more than
one new section before saving. They have to be randomized when inserting a
new section in order to make the datepicker work properly.

This patch implements an update() method in tceforms.js which is called
every time a new section is added to a flexform. The IDs of tceforms
date/datetime fields get randomized by adding a timestamp when adding a
new section.

Fixes: #23843
Releases: 4.7, 4.6, 4.5

Change-Id: I9ac6e21b06bd1928c7acc94906113811f1260868
Reviewed-on: http://review.typo3.org/8674
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog

Revision 70a53314 (diff)
Added by Stefan Rotsch over 8 years ago

[BUGFIX] Broken datepicker on unsaved flexform sections

The onClick event for opening the datepicker is attached to the
datepicker icons only once on page load. There currently is no update
method which adds the onClick event to new sections, so the datepicker
icons are without function until the form is saved.

Related to this, IDs of input fields are not unique when adding more than
one new section before saving. They have to be randomized when inserting a
new section in order to make the datepicker work properly.

This patch implements an update() method in tceforms.js which is called
every time a new section is added to a flexform. The IDs of tceforms
date/datetime fields get randomized by adding a timestamp when adding a
new section.

Fixes: #23843
Releases: 4.7, 4.6, 4.5
Change-Id: Id64144f41804e64b245b68f0135e1b6e8c1bab4c
Reviewed-on: http://review.typo3.org/8746
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision c669bda6 (diff)
Added by Stefan Rotsch over 8 years ago

[BUGFIX] Broken datepicker on unsaved flexform sections

The onClick event for opening the datepicker is attached to the
datepicker icons only once on page load. There currently is no update
method which adds the onClick event to new sections, so the datepicker
icons are without function until the form is saved.

Related to this, IDs of input fields are not unique when adding more than
one new section before saving. They have to be randomized when inserting a
new section in order to make the datepicker work properly.

This patch implements an update() method in tceforms.js which is called
every time a new section is added to a flexform. The IDs of tceforms
date/datetime fields get randomized by adding a timestamp when adding a
new section.

Change-Id: I6acee7f570be3314350c1ae1ca952096cf416746
Fixes: #23843
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/8745
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

History

#1 Updated by Gijs Oliemans almost 10 years ago

This issue affects product version 4.4.4 as well.

#2 Updated by Soeren Kracker almost 10 years ago

This issue affects me too. Version 4.4.4
Templavoila FCE with sections. If i add a new date field for the section, the calendar won't show up until the FCE is saved again.

#3 Updated by Gijs Oliemans over 9 years ago

This issue also affects version 4.5.0

#4 Updated by Stefan Rotsch almost 9 years ago

  • Target version deleted (0)

This issue is still present with TYPO3 4.5.8.

The onClick-event for opening the datepicker is attached to the datepicker icons when loading the page. There is no update-method which adds the event to new sections, so the icons are without function until the form is saved.

Related to this, IDs of input fields are not unique when adding more than one new section before saving. They have to be randomized on inserting a new section in order to make the datepicker work properly.

I have submitted a Patch to Gerrit, maybe you could try if it fixes this issue for you.

#5 Updated by Gerrit Code Review almost 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8674

#6 Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/8745

#7 Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/8746

#8 Updated by Anonymous over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#9 Updated by Gerrit Code Review over 8 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/8746

#10 Updated by Anonymous over 8 years ago

  • Status changed from Under Review to Resolved

#11 Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF