as follow up of #1083394: Meta issue: Features support for core component types added in D7
For a custom project I wrote some language implementation. Patch will come in first comment.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | features-locale-1279938-18.patch | 4.54 KB | helmo |
| #11 | features-locale-1279938-11.patch | 5.38 KB | derhasi |
| #8 | features-locale-1279938-8.patch | 5.41 KB | derhasi |
| #7 | features-locale-1279938-7.patch | 5.41 KB | helmo |
| #3 | features-locale-1279938-3.patch | 5.41 KB | derhasi |
Comments
Comment #1
derhasi commentedAnd there is the patch.
Comment #2
febbraro commentedYour patch is empty :)
Comment #3
derhasi commentedOk :D Finally it's here again ...
Comment #4
derhasi commentedComment #5
e2thex commentedTagging
Comment #6
apaatsio commentedI got this error when enabling a feature:
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'plurals' at row 1: UPDATE {languages} SET plurals=:db_update_placeholder_0, formula=:db_update_placeholder_1 WHERE (language = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => [:db_update_placeholder_1] => [:db_condition_placeholder_0] => fi ) in _features_language_save() (line 138 of /www/sites/all/modules/contrib/features/includes/features.locale.inc).Using
Comment #7
helmo commentedThe default value should probably be '0' instead of '', adding a new patch.
I didn't experience the error from #6 myself, but that's because I was testing a language which has plurals set to 2.
Comment #8
derhasi commented@helmo, I assume we even have to use
0instead of'0'.@apaatsio , could you review/test the patch again please? ;)
Comment #9
helmo commented@derhasi: Yes, the 0 is better.
I think that this is ready...
Comment #10
hefox commentedMinor coding standards issue; have you run the file through coder?
Missing .
+
+ // No pipe.
+ $pipe = array();
+ return $pipe;
This isn't against coding standards, but it just looks odd. I'd either put $pipe at the top, or return array();
Not against coding standards again, but tmk array_key_exists is slower and not as useful as !empty($language_list[$name]); for example, $language_list could be array('blah' => '') and array key exist would return true, despite blah being ''.
Commented out code? :(
New line!
Comment #11
derhasi commentedOh, sure coder ... and your are right with your other comments too ;)
I attached a cleaned up patch.
Comment #12
helmo commentedGreat, still works as expected :)
Comment #13
apaatsio commented#8 works for me
Comment #14
wmostrey commentedThe patch in #11 applies cleanly and works as expected. Great work Johannes!
Comment #15
duaelfr+1 RTBC
I would like to find a hook to add some code after reverting/rebuilding a feature.
For example, it would be nice to run l10n_update after importing new languages.
I tried
but it does not work :/
Comment #16
mpotter commentedCommitted 1027e94
Comment #17
duaelfrmpotter, it seems you forgot the include file :)
Comment #18
helmo commentedNew patch with the remaining includes/features.locale.inc file.
Comment #19
mpotter commentedAck. Just forgot to add the include file to git. Committed with include file f6ff815.