Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Existing :
In existing system, All cell in tablefield are “textfield”, where there is no option to have date field in the table cells.
Date in TableField:This patch will allow a date field in table cell(particular column) by specifying exact column numbers in field settings form.
Comment | File | Size | Author |
---|---|---|---|
#8 | date_column-2826794-8.patch | 5.07 KB | saranya ashokkumar |
#5 | date_column-2826794-5.patch | 5.23 KB | lolandese |
#2 | tablefield-2826794.patch | 4.89 KB | saranya ashokkumar |
Comments
Comment #2
saranya ashokkumar CreditAttribution: saranya ashokkumar at UniMity Solutions Pvt Limited commentedComment #3
saranya ashokkumar CreditAttribution: saranya ashokkumar at UniMity Solutions Pvt Limited commentedComment #4
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedThanks Saranya,
If you don't mind I add the link to your blog post that showcases this functionality:
http://www.unimitysolutions.com/blog/working-experience-table-field-cont...
Comment #5
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedReroll against latest dev.
Comment #6
thynan CreditAttribution: thynan commentedHi! This patch can't be applied anymore. Is it feasible to reroll it, or were there too many changes made in the codebase? If so, is there a better way to implement this functionality now?
Comment #7
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedYes. Try to apply changes "by hand", reroll and post a new patch here. Thanks.
Comment #8
saranya ashokkumar CreditAttribution: saranya ashokkumar at UniMity Solutions Pvt Limited commentedI have re-rolled patch for the current dev. please review.
Comment #9
useernamee CreditAttribution: useernamee at Agiledrop - Your Trusted Drupal Teammates commentedHey, I have tested the patch and it applies nicely. I just have a problem that I can not validate the form if I choose value in date field.
I get the following notice:
Notice: Undefined index: object in Drupal\Core\Datetime\Element\Datetime::validateDatetime() (line 370 of /var/www/sandbox/web/web/core/lib/Drupal/Core/Datetime/Element/Datetime.php) #0 /var/www/sandbox/web/web/core/includes/bootstrap.inc(582): _drupal_error_handler_real(8, 'Undefined index...', '/var/www/sandbo...', 370, Array) #1 /var/www/sandbox/web/web/core/lib/Drupal/Core/Datetime/Element/Datetime.php(370): _drupal_error_handler(8, 'Undefined index...', '/var/www/sandbo...', 370, Array) #2 [internal function]: Drupal\Core\Datetime\Element\Datetime::validateDatetime(Array, Object(Drupal\Core\Form\FormState), Array) #3 /var/www/sandbox/web/web/core/lib/Drupal/Core/Form/FormValidator.php(283): call_user_func_array(Array, Array) #4 /var/www/sandbox/web/web/core/lib/Drupal/Core/Form/FormValidator.php(239): Drupal\Core\Form\FormValidator->doValidateForm(Array, Object(Drupal\Core\Form\FormState)) #5 ...
And error:
The date is invalid. Please enter a date in the format 2018-04-18.
I can't set the field in this format because dd/mm/yyyy is allowed.
If I change type of tablefield in method
processTablefield
(from datetime into date) I still get similiar notice (Undefined index: Object in Drupal\Core\Datetime\Element\Date::processDate() ...) but at least the form gets validated and values are saved.(I am on Drupal 8.5.1 and php 7.1)
Comment #10
saranya ashokkumar CreditAttribution: saranya ashokkumar at UniMity Solutions Pvt Limited commented@useernamee ,
I think this error due to Drupal version. Already some issue going about this error in core.
https://www.drupal.org/project/drupal/issues/2812925
Comment #11
useernamee CreditAttribution: useernamee at Agiledrop - Your Trusted Drupal Teammates commentedI thought it might be some other issue.