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 System:
In existing system we have module table field with feature of adding rows and columns by the users enabled with required permission.
Proposed System:
TableField Module does not have feature to allow user to add row dynamically. Therefore I have created a option to add rows dynamically without adding columns if users enabled with “To change row in tablefield” permission
Comment | File | Size | Author |
---|---|---|---|
#10 | tablefield-2826793-13.patch | 5.03 KB | saranya ashokkumar |
#8 | interdiff-2826793-4-6.txt | 4.75 KB | lolandese |
#6 | tablefield-2826793-6.patch | 4.69 KB | saranya ashokkumar |
#4 | tablefield-2826793-4.patch | 4.16 KB | ctrlADel |
#2 | tablefield-2826793.patch | 4.6 KB | saranya ashokkumar |
Comments
Comment #2
saranya ashokkumar CreditAttribution: saranya ashokkumar at UniMity Solutions Pvt Limited commentedComment #3
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 #4
ctrlADelCouldn't apply the patch cleanly to the current dev version so here's an attempt at rerolling.
From what I can tell this isn't functioning quite right after the reroll. The button works on the first add but not if I click it a second time. Also rebuilding with more rows isn't working after patching.
Errors I'm seeing
Notice: Undefined index: value in Drupal\tablefield\Plugin\Field\FieldType\TablefieldItem->isEmpty() (line 199 of /var/www/docroot/modules/contrib/tablefield/src/Plugin/Field/FieldType/TablefieldItem.php)
Notice: Undefined index: rebuild in Drupal\tablefield\Element\Tablefield::processTablefield() (line 58 of /var/www/docroot/modules/contrib/tablefield/src/Element/Tablefield.php)
Comment #5
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedChanging status based on the comments in #4.
Comment #6
saranya ashokkumar CreditAttribution: saranya ashokkumar at UniMity Solutions Pvt Limited commentedHi,
I have updated the patch and it is working fine. Please Check it.
Thanks,
Saranya.P
Comment #7
saranya ashokkumar CreditAttribution: saranya ashokkumar at UniMity Solutions Pvt Limited commentedComment #8
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedRecommendation as for https://www.drupal.org/documentation/git/interdiff.
Comment #9
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedNow works as expected.
Still the case after adding a row with the button.
The undefined index errors seem to be solved.
Comment #10
saranya ashokkumar CreditAttribution: saranya ashokkumar at UniMity Solutions Pvt Limited commentedHi lolandese,
Thanks for your reviewing!
I have fixed the rebuild and undefined index issue and uploaded the patch.
Thanks,
Saranya.
Comment #11
saranya ashokkumar CreditAttribution: saranya ashokkumar at UniMity Solutions Pvt Limited commentedComment #13
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedThanks for your contribution.
One minor improvement could be to update the row number in the rebuild section after adding a row with the button.
Comment #15
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedThis was further improved at #2909827: Only validate the tablefield when adding a new row and update row value in the rebuild section: