First and foremost - this module is wonderful, works like a charm. But I ran into something that I haven't quite figure out how to "fix" or get around.

If I'm working in the site's default language (English) - things are great, no issue - my ddfs work.

Now.

If I flip the site to French, the node/add displays the lists "correctly"... but as soon as I select a category, the sub category list is displayed in English. (attached) - it works fine, it just displays the list in the wrong language.

My view is dead simple (attached)

Any thoughts as to what I might be doing wrong?

I'll keep debugging - in the meantime, if you have any ideas - let me know!!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

maximpodorov’s picture

Could you see the path of the DDF ajax request (in the Network tab of your browser debugging tool)? Does it contain language prefix or language domain or something similar?

nadine_cz’s picture

FileSize
16.72 KB
20.95 KB
27.05 KB

The http request to kick it off - the empty lists are showing the ‘Aucun’ label correctly.
myurl.com/fr/node/add/request?sr=1485

The category is selected – resulting URL (seems to not be ‘language’ aware).
myurl.com/ddf/update/field_category_er/node/request/NULL?form_build_id=form-fSGktu1gb34Ul-ymlf-qHQAd4cYDcGU2EbqiXmjUEC0&field_category_er=1974&dep%3Afield_sub_category_er=%23edit-field-sub-category-er-und

The response (see attached)

Date points:
When I submit the form and if I omit a few required fields causing validation to fail, my French subcategory list is displayed. But if I pick a different category, the dependent sub categories are displayed in English again.

I’ve put a whack of dpms in the ddf_entityreference_ddf_update_widget function (this is where the list gets mangled).

Anyways, this is as far as I’ve gotten – there are a lot of moving bits and I’m not 100% sure how they all fit together. I’m playing around with the hook_ddf_update_widget – just to see if I can hack my way through it/understand what’s going on.

nadine_cz’s picture

*click*

In the ddf.js I changed:

// var url = settings['basePath'] + 'ddf/update/' + field_name + '/' +

to

var url = settings['basePath'] + Drupal.settings.pathPrefix + 'ddf/update/' + field_name + '/' +

And this work wonderfully and beautifully!

PS: thanks for the hint!!!

nadine_cz’s picture

Took a stab at the patch...

maximpodorov’s picture

Status: Active » Fixed

Thank you. The patch is accepted with small modification.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.