After upgrading to rc7, all my address field labels suddenly became empty (both in order checkout, and in admin / edit address fields).

When I commented out the assignments to $conf['i18n_variables'][] in uc_store.module:uc_store_init(), the labels came back.

I don't have any uc_field_* variables in my {variables} table, so I expect to get the default names.
I have the i18n modules installed, latest release (6.x-1.1).

I have no experience with the use of i18n_variables so I didn't digg any further... Anything else I should try?

Comments

xibun’s picture

wimh’s picture

Yes that's exactly what I'm seeing.

wimh’s picture

Status: Active » Closed (duplicate)

Ok I think I got it: the problem is in the i18n module which messes up the default settings. (It writes an empty string to $conf[(my-i18n'd-variable)] instead of NULL or unset()ing it, variable_get() therefor just returns the "" instead of using our default).
They know of the problem #527534: Unset variables set to be multilingual don't show default values, the fix just isn't released yet but the patch in there works for me.

xibun’s picture

Did you do anything else then apply the patch? I'm using the dev version now and the problem is still the same.

gregober’s picture

Priority: Normal » Critical
Status: Closed (duplicate) » Closed (won't fix)
StatusFileSize
new24.65 KB

Sorry I have applied the patch in the i18n.module file and that didn't change anything.
I still have no field displayed on the checkout page.

xibun’s picture

Status: Closed (won't fix) » Active

@gregober: won't fix is the status a maintainer set's when he will not fix a problem. I put this back to active - even tough "duplicate" might be correct in the long run.

wimh’s picture

Did you do anything else then apply the patch? I'm using the dev version now and the problem is still the same.

I commented out some stuff in uc_store.module (see original post), that solved it.
Then I installed the patch for i18n, and reverted my changes to uc_store.module, and it kept working.
So I guess no, I didn't do anything else.

You mean the dev version of i18n ? Because the dev version of Ubercart won't help, nothing is changed there.

wimh’s picture

I also just checked my variables tables: both table variable and i18n_variable do not contain any uc_field_* variables (just as before), so nothing changed there either...

xibun’s picture

Thanks for coming back to this. Yes, I'm using the dev version of i18n as it includes the patch mentioned in #527534: Unset variables set to be multilingual don't show default values.

wimh’s picture

For you guys where it's not working: can you try the commenting out I did originally, and see if that solves it?

Also, did you by any change go to Admin > Store > Address Fields and pressed OK? This would save the empty field descriptions as your preferences, which override the default. So check the i18n_variables table and confirm it doesn't contain any uc_field_* entries (and delete them if there are any).

wimh’s picture

Also, did you by any change go to Admin > Store > Address Fields and pressed OK? This would save the empty field descriptions as your preferences, which override the default. So check the i18n_variables table and confirm it doesn't contain any uc_field_* entries (and delete them if there are any).

I just tried this myself (first undid the patch, pressed Save on the empty address fields, and redid the patch).
To get the names back I had to clear out the uc_field_* entries in table variables though, not i18n_variable (the latter didn't have any), and also clear out the caches, so something is probably wrong in the way I understand the i18n_variable thing. But I did get it fixed, so hopefully you can find some ideas here to make it work for you...

xibun’s picture

Status: Active » Fixed

Good news!

Commenting out the $conf assignments doesn't help.

But for some reason the Title fields in Address fields were empty! Filling them back in brought the fields in checkout back.
-> it's in "Store administration / Configuration / Checkout settings / Address fields"

Just as a note: my feeling is that it was not a manipulation mistake on my side, but a side effect of the update process.

Thanks wimh for solving this!

wimh’s picture

Status: Fixed » Active

Hi xibun, glad you got your site working again.
But we can't have everyone fill in the fields again manually, there should be an automatic fix, or a patch that prevents this from happening. I'm marking this issue as active again for now...

wimh’s picture

Status: Active » Needs review

I'll put it to "needs review" as we probably know what the solution is (apply #527534: Unset variables set to be multilingual don't show default values or install i18n-dev), but I'd like confirmation from someone else before closing this...

tearslake’s picture

Here's what I've done:
- Commented out in uc_store.module:uc_store_init() all $conf['i18n_variables'][] assignments
- Did the patch update for line (now it sets the NULL value) for i18n.module: $i18n_conf[$name] = isset($variables[$name]) ? $variables[$name] : (isset($conf[$name]) ? $conf[$name] : 'NULL');
- In database removed all uc_field_* entries from both tables: variable and i18n_variable
- Cleared the Drupal cache in admin/settings/performance

Now it shows all entries except the "Street address 2"... But I find it not necessary so I am happy :)

tearslake’s picture

Update: the "Add to cart" button text disappeared so I reverted everything back and installed the dev version of i18n module. All is working now.

Island Usurper’s picture

Status: Needs review » Closed (duplicate)