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: Changing the default language title during development

Status Resolved
Add-on / Version Publisher 1.0.12
Severity Trivial
EE Version 2.7.1

EECMS Bugs

Oct 08, 2013

Hi Brian,

I’ve been working a Publisher-powered site, and need to change the default language.  I have no real Channel Entry content so far, so there is no content to worry about on that end - however I do have a lot of Phrases already set up (all currently only translated with the previous default language).

When I change the default language, I get a number of PHP errors, the root of which appear down to the Phrases:

A PHP ERROR WAS ENCOUNTERED
Severity: Notice
Message: Undefined offset: 2
Filename: models/publisher_phrase.php
Line Number: 233

A PHP ERROR WAS ENCOUNTERED
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: publisher/mod.publisher.php
Line Number: 316

If I change the default language back, the errors go away, so it’s at least consistent behaviour.

Do I have no recourse other than to re-create all of the Phrases?

Cheers,
John

#1

BoldMinded (Brian)

The offset 2 is because 2 is the group id for the languages phrase group. Group 1 is the default. Both of these should be the same for all sites and can’t be deleted. I can’t think of why that error would happen though in this case. I’ll try to recreate and test locally.

#2

BoldMinded (Brian)

Yeah, I wasn’t able to replicate this. Did you reset your cookies or anything after changing it?

#3

EECMS Bugs

I opened up Safari and “reset” it completely.

Here’s my setup: I have 4 Phrase Groups: Default, Languages, Form Phrases, and Footer. I also have 2 Languages: English (default), and Portuguese.

If I dig into models/publisher_phrases.php and var_dump() the array keys of ee()->session->cache[‘publisher’][‘all_phrases’], I get, as you would expect, something along the lines of:

array(4) { [0]=> int(2) [1]=> int(1) [2]=> int(3) [3]=> int(4) }

But, when I change the default language to be Portuguese, this is what that same all_phrases array keys look like:

array(3) { [0]=> int(1) [1]=> int(3) [2]=> int(4) }

How weird is that?!

Cheers, John

#4

BoldMinded (Brian)

And all the phrases are translated into both languages?

#5

EECMS Bugs

Not yet, right now they’re all set up with default values only.

Do you want a database export?

(Oh man, I just realised that I’ve accidentally logged in with a testing Twitter account of mine. Oops - this is actually @johndwells!)

#6

BoldMinded (Brian)

Try entering translated values for all phrases, even if they are not accurate, just to get some data in there to see if that might be part of the issue.

#7

JohnDWells

That was it - as soon as I had at least one fully-translated phrase for both the Default & Languages groups, the errors went away. Curiously, it didn’t seem to matter that Groups 3 & 4 didn’t have any fully-translated phrases.

Odd - anyway I’m sorted now. Thanks Brian!

Cheers, John

Login to reply