- 🇺🇦Ukraine pablo_pukha
Pablo_Pukha → changed the visibility of the branch 3109763-save-button-on to hidden.
- 🇺🇦Ukraine pablo_pukha
Pablo_Pukha → changed the visibility of the branch 3109763-save-button-on to active.
- 🇺🇦Ukraine pablo_pukha
I create patch which added new view field "Form field: Submit button" for save entity on each row. Also, I attach video with preview
- Status changed to Needs review
6 months ago 1:39pm 22 June 2024 - 🇺🇸United States davemaxg
Pablo, thank you for this patch. I think it could be a nice workaround for this issue 🐛 Field values get swapped among different entities in a view Active that I just posted.
I am trying to apply it to 8.x-1.0-beta10 but it won't apply. What version should it work with?
I am thinking that this may be a better ui when there are multiple rows and form fields than having to save the whole page at once.
- 🇺🇦Ukraine pablo_pukha
I try apply this patch to 8.x-1.0-beta10 and patch applied successfully
- 🇺🇸United States davemaxg
Thanks for this updated patch. I ended up working around this issue, but was just checking in again and would love to get this working. It turns out that I have some translation related patches that must be conflicting. Here's what my composer.json looks like:
"drupal/views_entity_form_field": {
"fix issue related to translation": " https://www.drupal.org/files/issues/2021-06-18/views_entity_form_field_3... → ",
"fix multilingual updating issue": " https://www.drupal.org/files/issues/2021-06-29/views_entity_form_field-s... → ",
"add save button for each row": " https://www.drupal.org/files/issues/2024-08-23/add_save_button_on_each_r... → "
},Composer started to fail when I added the save button patch so I had to remove it.
- 🇫🇷France tostinni
The patch works fine for us, but if an entity doesn't need to be saved, it get recorded in
$rows_failed
due to this new code :protected function saveEntity(EntityInterface $entity, EntityInterface $original_entity, EntityStorageInterface $storage): bool { try { if ($this->entityShouldBeSaved($entity, $original_entity)) { $storage->save($entity); return TRUE; } } catch (\Exception $exception) { return FALSE; } return FALSE; }
Here is an updated patch to add this third option.
- 🇸🇰Slovakia coaston
Hi tostinni,
You patch works fine for me, but should not be there any AJAX ? It does not make sense to me to click save button and every time the page is reloaded. In my case I am working with modal window, hence once I click save , modal is being closed, but I would like to continue and save also other rows.
Also even there is not modal - it sill refresh the whole page and if there are 20 rows I need to remember still which wan was updated last because after the refresh I am on top.Would be possible to enable ajax call for this save button so it is saved immediately with no page reload ?