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: Assigning categories breaks output of grid with asset field in second language

Status Resolved
Add-on / Version Publisher 1.6.6
Severity
EE Version EE v2.10.1 - Build Date: 20150501

Barbara Cinotti

Oct 11, 2015

Hi Brian,

1) Fresh EE install without any addons except Publisher 1.6.6 and then Asset 2.6.
Setting 2 languages : En and IT (default), no modification to the default Publisher settings.
2) Create a channel “test”
3) Create a Channel Group Field “test”
4) Create 1 Grid field “test_grid” and inside it create 1 Assets field “image”
5) Create some other fields: 1 input text and 1 text area.
6) Create some entries and in the grid field add some rows with 1 image (Assets) each. Create the translated entries (without changing images).
7) Output the entries with this code

{exp:channel:entries channel="test" status="open" dynamic="no" publisher_enable_persistence="no"}
<h1>{title}</h1>
<p>{subtitle}</p>
<p>{body}<br />
    {test_grid}<br />
        {test_grid:image}<br />
            <img src="{test_grid:image:url}"><br />
        {/test_grid:image}<br />
    {/test_grid}<br />
{/exp:channel:entries}

8) Everything is correctly displayed on both languages.
9) Then Create a Category Group with some categories inside.
10) Assign Category Group to the Channel “test”.
11) Assign categories to each entries (both languages).
12) After assigning categories the output of the entries is correct in the default languages but not in the second one, only for the Grid/Asset field with the images. The other fields (input text and text area) are output correctly.

It seems that after assigning categories to the entries the second language miss something maybe relations regarding the grid/assets fields (in a random strange way… some are display some not…and if I tried to re-save the entries the output changes).

Do you have any idea?

Thanks, as usual, for your support,

Barbara

#1

BoldMinded (Brian)

Barbara, I just tried to replicate this and am not able to. I also don’t see how category assignments can change an Assets image field output inside of Grid. Those parts of the code are not at all related to each other.

#2

BoldMinded (Brian)

Is this consistently happening? Did you try it without the enable_persistence parameter? What about the persistence setting in the control panel? Did you try it with it on and off?

#3

Barbara Cinotti

Hi Brian Sorry for my late reply but I know that you were speaking at eeciconf so I don’t want stress you. I did a lot of test just to report you as much details as possible. I able to replicate The issue other two Times. Always changing enviroments and with fresh EE installation but i don’t come up with the Logic that this happens. Then in other test I don’t able to replicate it. Try also as you suggest to change persistence on/off either in template and in the settings. I’ll let you know if I discovered something else about it. Even because as you said category assigment should not be related with grid/Asset Thanks a lot Barbara

#4

BoldMinded (Brian)

Would you be able to provide CP and FTP access to an environment in which you have this issue occurring? Preferably one with only Publisher, Grid, and Assets installed, 1 template, etc. Basically the bare minimum EE needs to replicate the issue (makes it easier for me to debug and I don’t have to trudge through the CP or a mass of templates to find things).

#5

Barbara Cinotti

Comment has been marked private.

#6

BoldMinded (Brian)

Barbara, you have publisher_enable_persistence=”no” on your entries tag, are you sure you want to be doing this?

#7

BoldMinded (Brian)

Barbara, take a look at those example pages now. They appear to be working. This wasn’t an Assets or Categories issue. It was an issue with how Publisher handled Grid fields, which I believe is fixed now. Just grab the copy of libraries/hooks/Publisher_hooks_base.php from your demo site… the fix is in there and it’ll be included in the next Publisher release too.

#8

Barbara Cinotti

mhhh, I think that is the only way to force the correct output when there isn’t a translation for an entry. Right? I remember that in some previous version setting it in the pubblisher settings (Persistent Entries?) doesn’t work so you suggest to add publisher_enable_persistence=“no” in the tag to enforce it (now I think that this works). In my experience, works great for entries because there are a lot of situation (for example for news or press release) that are not always translated in the second languages and I don’t want fallback the entry in the default language. For other cases of use of persistence (ie with relationship, grid, matrix, etc fields) I usually don’t need them.

Do you mean that if I use publisher_enable_persistence=“no” in the tag it affects (or could be affect) the whole persistence in an entry?

Thanks,

Barbara

#9

Barbara Cinotti

Brian,

thanks for the fix, I’ll grab soon the new file!

I’ll give you feedback after some tests.

Thanks again for your support!

Barbara

#10

BoldMinded (Brian)

Ok, lets say you have 3 languages, English (default), German, and French.

Persistence basically means that every piece of content exists in all languages. For example, if you have 10 entries in English, then it will assume there are translations for all 10 entries in all other languages and show those entries regardless if there is a translation for it (it will show the English content as a fallback).

When you turn persistence off and if you have the same 10 entries, but 2 of them do not have a German translation, then when you are viewing the site in German, the entries tag loop will only show 8 entries. The Persistent Matrix and Relationship settings are similar, except it works with Matrix rows instead of the entries.

The feature was added because many people had a site that 90% of the pages/content existed in all languages, however, they might have had a news/blog feed, for example, that the posts did not pertain to all languages (mostly due to localization, not strictly translation).

Does that help explain it? Generally people leave persistence turned on… if you are on a page of your site and expect a full translation of that page in any language, then persistence should be kept turned on. You can almost think of it as an MSM site, where each site may have different content (persistence turned off).

#11

BoldMinded (Brian)

The publisher_enable_persistence parameter was mainly meant for those cases such as blog feeds where that was the only content type on the site that may not have a translation for all languages. So in that case it might be the only entries tag on your site where you have that parameter set to “no”, and you have persistence turned on by default for everything else on the site.

#12

Barbara Cinotti

Hi Brian, made some test, now works fine!

Thanks for the explanation for the persistence, really appreciated it! Now it’s clear!

Thanks a lot again,

Barbara

#13

BoldMinded (Brian)

Barbara, I’m re-opening this because the fix I made for you did not work on someone else’s site. Would you mind trying the build link in the next comment and see if the Grid field still renders how you expect it to? Also if you could copy/paste the entire entries tag code in which the Grid field you are displaying is or isn’t working. I’m especially interested in the parameters you’re using. Thanks.

#14

BoldMinded (Brian)

Comment has been marked private.

#15

BoldMinded (Brian)

Comment has been marked private.

#16

Barbara Cinotti

Hi Brian!

sure!

I’m gonna dowload the new build and do some tests. I’ll let you know and report yo you everything that can help soon,

Thanks

Barbara

#17

Barbara Cinotti

Comment has been marked private.

#18

BoldMinded (Brian)

Would you be able to provide FTP access so I can debug in your environment? Or maybe better yet zip up the files and a database dump so I can run this locally and debug it that way? You could share the files via Dropbox or something.

#19

BoldMinded (Brian)

Thanks for the files. I’ll try to take a look today or this weekend. Could you tell me the CP login too? Mark the message private.

#20

BoldMinded (Brian)

Never mind about the login, I got the site up and running and I’m in.

#21

BoldMinded (Brian)

Barbara, try this build https://www.dropbox.com/s/ga4c7lkbh3gt3ex/publisher-168-27a711d9.zip?dl=0

#22

Barbara Cinotti

Comment has been marked private.

#23

BoldMinded (Brian)

Barbara, try deleting everything in your exp_channel_grid_ tables and re-saving the entries with new rows. In the database dump you sent me yesterday I noticed some duplicate rows, which may have been throwing things off.

#24

Barbara Cinotti

Comment has been marked private.

#25

BoldMinded (Brian)

Oh good news 😊

#26

BoldMinded (Brian)

Barbara, try the build in the next message. The one I sent could throw an error message if there is no default translation. See https://boldminded.com/support/ticket/1234

#27

BoldMinded (Brian)

https://www.dropbox.com/s/8wxfyj0jek5jtfl/publisher-169-44b37040.zip?dl=0

#28

Barbara Cinotti

Hi Brian,

I’ve installed the build you sent to me.

If I create a new entry from scratch, without the default language, but switching directly to the second language I return these warning on top:

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 2

Filename: hooks/Publisher_hooks_base.php

Line Number: 362
A PHP Error was encountered

Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: hooks/Publisher_hooks_base.php

Line Number: 362

I also replicated it on a new fresh installation (only Publisher no other addons) and I had the same message.

Hope this help you.

Barbara

#29

BoldMinded (Brian)

Comment has been marked private.

#30

Barbara Cinotti

Great!

warning messages gone away! it works well on both local and dev server!

Thanks again for your speady support Brian!

Barbara

Login to reply