CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Price Option Translations Not Working On Multlingual Site
Pages: [1]

Author Topic: Price Option Translations Not Working On Multlingual Site  (Read 575 times)

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Price Option Translations Not Working On Multlingual Site
November 06, 2013, 02:40:21 pm
I have been banging my head against this one for a few weeks now and I'm starting to think this is a bug in the multilingual functionality.  I have a multilingual site that is using English (Canada) and French (French).  The administrator panel is in English and the front end uses JoomFish to switch between English which is the default and French.  On the administrator panel, when I go in to edit the Price Options on a radio button Price Field the main label displays correctly and updates correctly no matter which language Civi is set to (I have changed it just to test this).  However, when I use the quick link next to the field to view all labels in all languages, it pulls the wrong translations into the fields.  I have also watched the database after submitting changes and confirmed that the wrong row in the price_field_value table is updated.

I have tested this on other sites, including a clean install just for testing this problem and confirmed that it is not just this one install this happens on.  I am running Joomla 2.5.14 and CiviCRM 4.3.7.  I'm not sure where in the code the translations pop up is called for the Price Sets, and would appreciate any guidance that people might have to help me figure out how to fix this.

Thanks!
CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Price Option Translations Not Working On Multlingual Site
November 07, 2013, 06:29:19 am
Hi,

Could you post a screenshot of the form where the popup icon is shown? (to edit the field in all languages), + the civicrm URL of the page? I'm not sure if I'm looking at the same screen.

If it can help to debug, those icons are called in the smarty templates. For example:

templates/CRM/Price/Form/Set.tpl:

{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_set' field='title' id=$sid}{/if}{$form.title.html}

templates/CRM/Price/Form/Option.tpl:

<td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='label' id=$sid}{/if}{$form.label.html}</td>

templates/CRM/Price/Form/Field.tpl:

<td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field' field='label' id=$fid}{/if}{$form.label.html}

It's easy to do a copy-paste error and use the wrong 'id' in the tag. The URL of the page you are editing will probably hint as to which template is being called.

To debug the smarty variables, you can enable debugging, and add {debug} in the template, or add "&smartyDebug=1" to the URL.

Mathieu
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Re: Price Option Translations Not Working On Multlingual Site
November 07, 2013, 07:50:49 am
Thanks Mathieu.

I did find those pieces of code, I actually think the id might be the problem.  Here are the screenshots.  I am on /administrator/?option=com_civicrm&task=civicrm/admin/price/field/option&reset=1&action=update&oid=28&fid=15&sid=12

When I go into manage the price options the first image shows the screen I land on.  When I click the smarty image circled in red I get the popup shown in the second image.  As you can see, the values even in the English box does not match, those are actually the values for a different price option.  Looking at the database it appears that it is pulling the data based on the SID out of the price_field_value table instead of based on the OID like it should be.  When I update the values in box on image 2 it updates ID 12 (which is the sid) in the price_field_value table instead of id 28 which is the OID.


CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Price Option Translations Not Working On Multlingual Site

This forum was archived on 2017-11-26.