Skip to content

Update version and fix state name retrieval - #67

Open
Maofree wants to merge 1 commit into
PrestaShop:devfrom
Maofree:patch-1
Open

Update version and fix state name retrieval#67
Maofree wants to merge 1 commit into
PrestaShop:devfrom
Maofree:patch-1

Conversation

@Maofree

@Maofree Maofree commented Mar 24, 2026

Copy link
Copy Markdown

Updated version number from 3.3.3 to 3.3.4 and modified state retrieval logic to use the default name. the

Changing versions is necessary to apply fixes made in the past that aren't present in the stable version of PrestaShop. For example, I keep seeing these lines in 3.3.3.

$is_state_multilang = !empty(State::$definition['multilang']); $state_name = (new State($address->id_state))->name;

Questions Answers
Description? In the previous version, the code attempted to access the state name as a localized array:@Maofree Could you please open a PR for the module? It is the easiest way to implement these changes. :-)
new State($address->id_state))->name[$this->context->language->id]
However, in current PrestaShop core versions, the State::$name property is not a multilang field. This caused issues (Notice or Error depending on environment) when trying to display contact information in the footer/widget. The logic has been simplified to use the direct property.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes PrestaShop/PrestaShop#31792
How to test? Enable the module to display in the footer or contact page. Observe that without this fix, the state name might not appear correctly or trigger an "Illegal offset" warning if error reporting is on. die(var_dump((new State($address->id_state))->name)); I can see "Italia" instead with (new State($address->id_state))->name I see "i"

Updated version number from 3.3.3 to 3.3.4 and modified state retrieval logic to use the default name.
the

Changing versions is necessary to apply fixes made in the past that aren't present in the stable version of PrestaShop. For example, I keep seeing these lines in 3.3.3.

$is_state_multilang = !empty(State::$definition['multilang']);
$state_name = (new State($address->id_state))->name;
@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard May 5, 2026
@Codencode
Codencode requested a review from Hlavtox May 5, 2026 09:29
@Maofree

Maofree commented May 5, 2026

Copy link
Copy Markdown
Author

Hi @Codencode
but I didn't change the version of the config.xml file
I didn't know if I should do this myself, since if there were other changes made by other programmers there would be problems with the version numbers

@Codencode

Codencode commented May 5, 2026

Copy link
Copy Markdown
Member

Hi @Codencode but I didn't change the version of the config.xml file I didn't know if I should do this myself, since if there were other changes made by other programmers there would be problems with the version numbers

We ask @Hlavtox, who has more experience on the matter than I do :), Daniel, in this case, should the version number be updated directly in this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Some errors in ps_contactinfo version 3.3.2

3 participants