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: Categories / Switcher sporadic errors

Status Resolved
Add-on / Version Publisher 2.9.0
Severity
EE Version 4.3.4

Lincoln Gbenga Olagbaju

Sep 05, 2018

Description:
Switching language by clicking on the “Italiano” link is somehow inconsistent, sometimes it works and the url becomes https://www.site.com/valvole-oleodinamiche sometime i will be presented with an error “Error The page you requested was not found.” so that error shows up sporadically.
*valvole-oleodinamiche is the Template Translation of hydraulic-valves
Default Language choice is working perfectly https://www.site.com/hydraulic-valves
Detailed steps to reproduce the issue:
1.
On https://www.site.com/hydraulic-valves , i have a list of child categories being outputed using GWCode Categories

{exp:gwcode_categories channel="hydraulic_valves" depth="2" style="linear" variable_prefix="gw:" parse="inward"}
{exp:publisher:translate_category cat_id="{gw:cat_id}"}
<div class='grid-x grid-padding-x>	
<div class="medium-4 cell flex-container">
<div class="card product-card">
<a href="{path="/hydraulic-valves/{cat_url_title}"}" title="{cat_name}">
{exp:ce_img:pair src="{cat_image}" alt="{title}" crop="yes" attribute='class="float-center"' quality="80"}<img src="{made}"/> {/exp:ce_img:pair}
</a>
<div class="card-section-product">
<h3><a href="{path="/hydraulic-valves/{cat_url_title}"}" title="{cat_name}">{cat_name}</a></h3>
</div>
</div>
</div>
</div>
<p>{/exp:publisher:translate_category}<br />
{/exp:gwcode_categories}

2.On the Italiano translated url https://www.site.com/valvole-oleodinamiche, all the links generated by the above combo GwCode and Publisher translate category such as https://www.site.com/valvole-oleodinamiche/valvole-equilibratici-a-2-vie (where segment_2 is a translated category url title) always redirect to https://www.site.com/hydraulic-valves
3.Another issue is that the translated Category status label isn’t green

#1

BoldMinded (Brian)

First thing to try is to enable the language prefix in the url to see if for some reason its not loading the correct language. It’ll then add /en/ or /it/ to the URL, which it should pick up on and force the language, and hopefully fix the issue. If thats the case then I know where to look for the potential error in the code.

#2

BoldMinded (Brian)

Comment has been marked private.

#3

Lincoln Gbenga Olagbaju

Hi, I’ve implemented both suggestions, issues not solved.

#4

BoldMinded (Brian)

Try taking GW Code Categories out of the equation and replace {gw:cat_id} with the hard coded category ID of what you expect {gw:cat_id} to print and see if it works.

If that doesn’t work then create a brand new template with only the template code you included above (no css, no header, no footer, no other entries tags etc, just the bare minimum to re-create the issue) and provide FTP access so I can debug that template directly on the server.

#5

Lincoln Gbenga Olagbaju

Comment has been marked private.

#6

BoldMinded (Brian)

Try simplifying that code some more. Remove the CE Image tag. I just tested the same code locally and it worked fine. This is what I tested:

{exp:publisher:translate_category cat_id="1"}
<a href="http://{path=" title="{cat_name}">{cat_name}</a>
{/exp:publisher:translate_category}

“cards” is my category name just like your “hydraulic-valves”

#7

Lincoln Gbenga Olagbaju

Comment has been marked private.

#8

BoldMinded (Brian)

Try to use a different category name and template name. E.g. you have a template group called Hydraulic Valves, a category group called Hydraulic Valves, and a category called Hydraulic Valves (all with the same category url title). I’m wondering if wires are getting crossed and its not sure how to translate the url. I’m also wondering if something is cached incorrectly, but I can’t clear EE’s cache with the account you provided.

#9

BoldMinded (Brian)

I removed the FTP info from your comment earlier. Its not secure to post credentials into comments. I tried the FTP info provided but I can’t save files in the addons/publisher folder. When the FTP permissions are corrected edit this ticket and put the info into the field provided. When the ticket is closed all the credentials will be deleted from my database for security purposes.

#10

Lincoln Gbenga Olagbaju

Comment has been marked private.

#11

BoldMinded (Brian)

Re-add the credentials in a comment and I’ll move them to the appropriate fields, then remove it from the comment.

#12

Lincoln Gbenga Olagbaju

Comment has been marked private.

#13

Lincoln Gbenga Olagbaju

Comment has been marked private.

#14

BoldMinded (Brian)

Thanks for fixing the FTP permissions, looks like I can save files now. I moved the FTP info to the ticket details and will try to look into this ticket again later today or tomorrow.

I also moved the old Publisher folder out of the add-ons directory and re-activated the 2.9.0 version in the add-ons directory. Having 2 of the same add-on, even if the folders are named different, can cause issues with EE.

#15

Lincoln Gbenga Olagbaju

Comment has been marked private.

#16

BoldMinded (Brian)

Well, part of the problem is URL Translations were not enabled. The other part of the problem, and I’m not sure if this is a bug yet, is that the template name is the same as a category name, so it may be getting confused on how to translate it.

#17

BoldMinded (Brian)

The URL Translations were disabled: https://d.pr/i/oLVmGQ

I don’t know if you restored an old DB or what, but the category translation was missing: https://d.pr/i/v5DDwk

Resulting in: https://d.pr/i/suIPOK

Which appears to be working fine.

#18

Lincoln Gbenga Olagbaju

Comment has been marked private.

#19

BoldMinded (Brian)

The translation status won’t go green until all fields are saved with a value.

#20

BoldMinded (Brian)

…which includes the image field.

#21

BoldMinded (Brian)

If you’re referring to the left navigation not working put that code into a new template like you did the first example. I’m pretty sure the translations are working as they should, so double check your template code.

#22

Lincoln Gbenga Olagbaju

Comment has been marked private.

#23

BoldMinded (Brian)

Can you increase my CP permissions so I can see the database manager so I can see what values are actually in the DB, and so I can clear the cache?

#24

BoldMinded (Brian)

I’m not sure why the switcher code is not translating the last category, its using the same methods as the {path=”“} variable is using to translate the URL, which is working with the second category in the URL. https://d.pr/i/wNshnt

#25

BoldMinded (Brian)

Comment has been marked private.

#26

Lincoln Gbenga Olagbaju

Comment has been marked private.

#27

BoldMinded (Brian)

Can you be more descriptive on what I should be taking a closer look at? How are the links in the articles section created? Which link specifically and what do you expect to happen? Screenshots or video would be appreciated. Also, again, the most stripped down version of the template where the error is happening. Create a new test template if you have to. It’s extremely difficult debugging someone else’s full templates. Lots of stuff happens behind the scenes that makes debugging difficult. The simpler it is the easier and faster it is for me.

#28

Lincoln Gbenga Olagbaju

Comment has been marked private.

#29

Lincoln Gbenga Olagbaju

Comment has been marked private.

#30

BoldMinded (Brian)

Did you check to make sure {last_segment_category_id} is the value you expect? Did you try to hard-code the category parameter? E.g. category=”1”

#31

BoldMinded (Brian)

Thats the problem, the category parameter isn’t working. https://d.pr/i/eSirPi

#32

BoldMinded (Brian)

I don’t even see an add-on installed that would give you the {last_segment_category_id} variable. Usually its Low SegToCat, but that doesn’t work with Publisher. Try this one. https://github.com/litzinger/URL-Helper

#33

Lincoln Gbenga Olagbaju

Comment has been marked private.

#34

BoldMinded (Brian)

If you have URL Helper installed, you don’t need Low Seg2Cat anymore. I’d uninstall it so they don’t conflict. URL Helper does everything Seg2Cat does and more.

Yes, I’ve logged into the cp and checked the templates. I’m not sure what you’re asking though.

#35

Lincoln Gbenga Olagbaju

Comment has been marked private.

#36

Lincoln Gbenga Olagbaju

Comment has been marked private.

#37

BoldMinded (Brian)

I don’t see either of those add-ons installed. This is what I see: https://d.pr/i/91fmOU

#38

Lincoln Gbenga Olagbaju

Comment has been marked private.

#39

BoldMinded (Brian)

The member permissions you assigned me must not see all the add-ons. Uninstall Low Seg2Cat and see if that fixes the issue.

#40

Lincoln Gbenga Olagbaju

Comment has been marked private.

#41

BoldMinded (Brian)

This is the problem with not using the prefixes. You can’t just open the English url then the Italian url and expect the IT page to be translated. Your bowser cookie is still set to EN so there is no way to know that you’re looking at an IT page. You need to either use prefixes, or you must use the language switcher to change languages.

#42

Lincoln Gbenga Olagbaju

Hi Brian, thanks, will move forward with the url prefix for the Italian version. You can consider this support ticket closed.

thanks
/it/grazie

Login to reply