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)
Jun 06, 2023
Did you try the 3rd and 4th parameters, specifically the 4th param to refresh the cache?
Eric Swierczek
Jun 06, 2023
Yes, the way I’m actually calling this is
but only the first 2 parameters seemed relevant in the logic ofBoldMinded (Brian)
Jun 06, 2023
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
Jun 06, 2023
Yes, calling this from the `publisher_entry_save_end` hook in my own extension. And the `uris` themselves are the translated versions, but the `url` 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, so `uris` is correctly the English values, but `url` is still the German value. But saving an entry in English while calling `->get()` with the German language ID should show the issue too (German `uris` but English `url`).
BoldMinded (Brian)
Jun 25, 2023
Comment has been marked private.
BoldMinded (Brian)
Jul 15, 2023
Eric, I’m marking this as resolved. If the issues still occurs with that latest build just reopen the ticket.