Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Simple Grid inside of grid, inside fluid field -  row saving issue, and simple grid file issue.

Status Resolved
Add-on / Version Simple Grids & Tables 1.1.0
Severity
EE Version 5.2.2

Aaron Jay

Apr 04, 2019

I’m having an issue with a simple grid field that’s contained within a grid field, within a fluid field.

It seems to be sporadic and it’s not clear what’s going on, but I don’t get any console errors or PHP errors.

I can add as many grid rows as I like and that’s fine. Actually, while testing and writing this, it appears to be perfect when you initially create an entry, but when I save an entry that exists after adding any new rows, the rows in the simple grid disappear. Sometimes I can get it to save one row, sometimes 2, sometimes none.

I’ve setup an example install for you to view this happening.

My second issue is related, in the same fields, if I upload an image (or other files) using the file field, it’s uploaded and attached to all simple grid file fields contained within the same fluid field. I need it to only attach to the selected simple grid row.

Actually, while writing and testing, there’s a 3rd related issue. The file field within simple grid outputs nothing on the front end.

In my example install, there is only one channel “Test Channel”, and the field(s) in question are “sg_within_g_within_fluid (the fluid field)”, and “simple_grid_within_grid”. Everything is running from the index.html template in the site.group template group.

#1

BoldMinded (Brian)

Hi, Aaron. This sounds like a bit of a complicated issue so it may be a few days before I can get an update to you.

#2

Aaron Jay

Hi Brian,

Okay, keep me posted.

Thanks, Sam

#3

BoldMinded (Brian)

Comment has been marked private.

#4

Aaron Jay

Okay great, that works after deleting all of the existing entry content and trying again, otherwise, the grid rows now work, but the other two file related issues will still persist.

#5

BoldMinded (Brian)

This ticket was closed, maybe inadvertently, so I forgot about it. I’ll take a look at the image issue early this week.

#6

BoldMinded (Brian)

Aaron, I wasn’t able to replicate that. Images seemed to work fine for me: https://d.pr/i/pnhTCp

#7

Aaron Jay

Hi Brian,

Thanks, yes images seem to be fine now. I still seem to be having some issues with the file field again though.

I’ve been working on a site in development, and it can appear to be ok while editing initially. What seems to trigger the file persistence across rows is if you create empty rows, then save, then go back and attempt to attach files to those once empty rows. As soon as you do, that file will persist, and override the other file fields even in seperate simple grids held within seperate grid fields.

I’ve replicated this on my demo site with the latest build you’ve sent me. Can you take a look and let me know once you’ve figured something out?

Thanks

#8

BoldMinded (Brian)

I’ll take another look at it with the steps to reproduce that you just described, but it will be a few days until I can do so.

#9

BoldMinded (Brian)

This one might take more than a few days to figure out. I’m not sure what is happening. The JS is a React component, so I have to debug that.

#10

Aaron Jay

Ok, keep me in the loop anyway. It’s odd that it’s only doing it if you save an empty row then go back. I find if you save it once it’s replaced the file, it does actually overwrite all rows, so you can’t recover the data, and once it’s been saved like that, you need to delete all rows and start again.

Its probably some kind of state issue or something but we’ll see anyway.

#11

Aaron Jay

Hi Brian,

Any movement on this issue?

Thanks

#12

BoldMinded (Brian)

Not yet. Sorry.

#13

Aaron Jay

Hi Brian,

I’m getting a bit worried as this needs to be deployed within a production site shortly. Can you give me an estimate of when you think this will be fixed?

Thanks

#14

BoldMinded (Brian)

I’m sorry this one is taking so long. I’ve looked at it on 3 different occasions and can’t figure out why it is behaving this way. The behavior is very specific to a series of steps, so IMO it is something that can be worked around unless you are editing the same entry/field over and over again. I realize it is a bit annoying, but I don’t have a magical fix and I have to debug this through 3 different custom fields. Is there a different way you can model your data? A grid inside of a grid inside of Fluid is quite a complex schema.

#15

BoldMinded (Brian)

Aaron, can you take a video of the steps to replicate this? I’m looking into this again and this time I can’t seem to replicate it.

#16

BoldMinded (Brian)

Nevermind, I don’t need a video, I can replicate it now.

#17

BoldMinded (Brian)

I’ve figured out why its happening, but I’m not sure what the fix is. So if a new row is added but no image is assigned to that row then the entry is saved the page reloads with the new grid row, but the image field is still awaiting a file to be attached. The issue is on the reload the “grid-file-upload” class is not added to the parent <td> class. If you add another row to the grid the image attachment works correctly because the newly added row is added by copying a hidden row in the DOM, which does have the “grid-file-upload” class on it. I don’t know why a non-dynamically added row doesn’t have that class.

#18

Aaron Jay

Thanks for getting back to me, unfortunately we require some additional flexibility in this site, hence the complex data structure.

Ok anyway, so as a workaround for now, deleting the blank row, but adding a new one seems to work.

Would there be anyway to persist that class on non-dynamically added rows? Or, is it a case of EE treating the field as filled even when it’s not?

For the meantime, I’ll take note that blank rows shouldn’t be saved, and if they are and then revisited, they’ll need to be wiped and replaced with new rows.

#19

Aaron Jay

I’ve also noticed, it hides the file field entirely if you go back into an entry that’s had multiple blank rows saved, and then you delete one to add a new row. Once you populate the new row, all previously added empty rows with no file field will hide the file field.

https://ibb.co/n7C8wR3 https://ibb.co/jH74tvS

#20

BoldMinded (Brian)

Comment has been marked private.

#21

Aaron Jay

Hi Brian,

That does appear to fix both of those issues. I’m going to test it a little more in the actual site, but I’ll mark this as resolved now.

Thanks again for the support.

Login to reply