When the default language is not neutral the title autocomplete in profile node edit/add does not work. This is because the JS in module phase2_profile targets the first and last name with hard coded id's, and as long as the site has neutral languages it works fine, but when switch to another, it fails.
The change basically allows to some flexibility in that regard by passing a prebuilt Id to the JS.
Here are some of the changes:
var sources = {
- firstname: $('#edit-field-profile-first-name-und-0-value', context).addClass('display-name-source'),
- lastname: $('#edit-field-profile-last-name-und-0-value', context).addClass('display-name-source'),
- orgname: $('#edit-field-profile-organization-und-0-value', context).addClass('display-name-source'),
+ firstname: $(firstname, context).addClass('display-name-source'),
+ lastname: $(lastname, context).addClass('display-name-source'),
+ orgname: $(orgname, context).addClass('display-name-source'),
}
This is how it is built in PHP
+ $lang = $form[$field_name]['#language'];
+ $field_id = '#edit-' . str_replace('_', '-', $form[$field_name][$lang][0]['value']['#field_name']) . '-' . $lang . '-0' . '-value';
+ $settings[$js_var_name] = $field_id;
| Comment | File | Size | Author |
|---|---|---|---|
| title-not-being-autopopulated.openpublic.patch | 2.44 KB | fxarte |
Comments
Comment #1
e2thex commentedcommited to 1.0.4
http://drupal.org/commitlog/commit/15670/f499b5c54f563510c499f041162cbd3...