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: ee()->publisher_site_pages->get() doesn’t completely follow lang ID parameter
Status | Resolved |
Add-on / Version | Publisher 3.9.1 |
Severity | |
EE Version | 6.4.2 |
Eric Swierczek
Jun 06, 2023calling `ee()->publisher_site_pages->get($langId = 1, false)` when I’m currently saving an entry in language != 1 sets/returns `$site_pages[$this->siteId][‘url’] = ee()->config->slash_item(‘site_url’);` (line 941) which isn’t the url value I’d expect back, considering I called get() with a specific language ID. e.g. it returns
array(1) {
[1]=>
array(3) {
["url"]=>
string(26) "https://local.site.com/de/"
["uris"]=>
array(2) {
[123]=>
string(1) "/"
[567]=>
string(8) "/contact"
where `url` is for language 4, but `uris` is for language 1. When I call the function like `->get(4, false)`:
array(1) {
[1]=>
array(3) {
["url"]=>
string(26) "https://local.site.com/de/"
["uris"]=>
array(2) {
[123]=>
string(1) "/"
[567]=>
string(8) "/kontakt"
BoldMinded (Brian)
Did you try the 3rd and 4th parameters, specifically the 4th param to refresh the cache?
Eric Swierczek
Yes, the way I’m actually calling this is
but only the first 2 parameters seemed relevant in the logic of
BoldMinded (Brian)
For documentation, and so I’m clear and don’t forget this when I find time to look into this… in the middle of an entry save, calling ee()->publisher_site_pages->get(4, false, ‘open’, true); ends up returning the site pages data for English/default, instead of German? And you’re calling this function in your own extension using the publisher_entry_save_end hook?
Eric Swierczek
Yes, calling this from the
publisher_entry_save_end
hook in my own extension. And theuris
themselves are the translated versions, but theurl
value is the current language’s url, not following the$lang_id
parameter. My test case was saving an entry in German, and then calling->get()
with the English language ID, souris
is correctly the English values, buturl
is still the German value. But saving an entry in English while calling->get()
with the German language ID should show the issue too (Germanuris
but Englishurl
).BoldMinded (Brian)
Comment has been marked private.
BoldMinded (Brian)
Eric, I’m marking this as resolved. If the issues still occurs with that latest build just reopen the ticket.