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: Running a “not IS_EMPTY” conditional on a grid field
Status | Resolved |
Add-on / Version | Publisher Lite 1.1.4 |
Severity | Critical |
EE Version | 2.7.3 |
Stephen Tidmore
Mar 05, 2014I’m using this channel entries tag to find all entries that have content in a grid field:
{exp:channel:entries channel="channel_name" search:field_name="not IS_EMPTY" dynamic="no" limit="1000" disable="pagination|member_data|categories"}
This worked fine until we installed Publisher and the client began saving entries as drafts and publishing those entries. It looks like once that happens, the content in the field column for that entry in the exp_channel_data field actually is empty so that conditional isn’t working correctly for any entry that has been edited using Publisher.
Does that sounds like it’s what’s happening here to you? If so, do you know of a workaround?
Thanks,
Stephen
BoldMinded (Brian)
Hi, Stephen. I think I know what the issue is since you mention it. I had a similar issue with Matrix awhile back. I might be able to get a fix to you by Friday, but more likely looking at early next week if thats ok.
Stephen
As soon as you could get a fix would be great. This is causing some issues on a site that’s live right now. Can you think of a temporary workaround? If not, I’ll see what I can do in the code or I’ll go into the database and manually add information to the field for each entry that needs it.
BoldMinded (Brian)
Are you positive this worked before Publisher? Looking at the Grid code it seems to only update the exp_channel_data table if the columns were made searchable. https://www.evernote.com/shard/s9/sh/7acfc7ce-c16e-45ae-8478-7dd6ed87b074/1190c03d31f8f0e9757ea9ab7ef1e0b4
BoldMinded (Brian)
Are you saving entries with Grid fields as draft, but no values in the Grid columns?
Stephen
Odd. Yes, this definitely worked before Publisher was installed.
All of the entries that have not been edited since we started using Publisher are working correctly - there is information in that field column in the exp_channel_data table. Once an entry is edited now that we’re using Publisher the information in that field column goes away.
The columns are all set to be searchable for these grid fields.
Stephen
Missed your last comment while I was posting mine
No, we’re not saving entries with grid fields as draft without any information in the Grid columns. Basically, an editor is logging in, editing the grid field which contains a file field and a text field column, and then submitting that entry for approval. Once the entry is approved it goes live on the site, but the section where we’re running that conditional is slowly loosing entries as that happens.
When they are editing the grid fields they are sometimes adding rows and sometimes just adding a new file or changing the text in the columns.
BoldMinded (Brian)
Do you need the fields to be searchable?
BoldMinded (Brian)
I can get you a fix in the morning, but it will render the fields non-searchable. Unfortunately I can save a “1” to the field so it has a value, or the data from each column/row in the language it was just saved as, not all language data compiled. Fixing this for Matrix and Grid has been on my agenda for some time, but it won’t be a small task.
Stephen
Thanks Brian. I’m not sure if I want all those fields to be non-searchable. Is there any easier way to do this since this site is just using Publisher Lite and doesn’t involve multiple languages? I wasn’t thinking about the complexity of this with using multiple languages.
Stephen
Just wanted to let you know that I’ve figured out a workaround for now using Stash (I was trying to avoid using the Query module).
I’m still interested in a fix to avoid this workaround on other sites, but it’s not as quite as urgent right now.
BoldMinded (Brian)
Good to hear. Sorry this didn’t work as you expected. Its the top feature to work on for me now b/c its long overdue.
BoldMinded (Brian)
Stephen, I just finished my new searchable class, which takes all Matrix and Grid searchable data and saves it to the channel_data and publisher_data tables accordingly so the search:field_name parameter would work. I can send you this build if you want to test it out… in dev environment after you do a database backup first 😊
Stephen
Thanks Brian. The work around is working fine for me now on this site. If you’d like someone to test it, send it over and I’ll test it on a local install.
Also, not sure if this matters, but I’ve upgraded to Publisher Lite 1.2.2 on this site since starting this thread.
BoldMinded (Brian)
New zip file sent.
BoldMinded (Brian)
Stephen, going to close this. If you end up testing it just shoot me an email or open a new ticket.