Support from Acquia helps fund testing for Drupal Acquia logo

Comments

derhasi’s picture

Status: Active » Needs review
FileSize
0 bytes

And there is the patch.

febbraro’s picture

Status: Needs review » Needs work

Your patch is empty :)

derhasi’s picture

Ok :D Finally it's here again ...

derhasi’s picture

Status: Needs work » Needs review
e2thex’s picture

Issue tags: +sprint candidate

Tagging

apaatsio’s picture

Status: Needs review » Needs work

I 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

  • Drupal 7.8
  • features 7.x-1.0-beta4 with the patch #3
  • MySQL 5.1.41
helmo’s picture

Status: Needs work » Needs review
FileSize
5.41 KB
+++ b/includes/features.locale.inc
@@ -0,0 +1,160 @@
+        'plurals' => empty($language->plurals) ? '' : $language->plurals,

The 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.

derhasi’s picture

@helmo, I assume we even have to use 0 instead of '0'.

@apaatsio , could you review/test the patch again please? ;)

helmo’s picture

Status: Needs review » Reviewed & tested by the community

@derhasi: Yes, the 0 is better.

I think that this is ready...

hefox’s picture

Status: Reviewed & tested by the community » Needs work

Minor coding standards issue; have you run the file through coder?

+++ b/includes/features.locale.inc
@@ -0,0 +1,160 @@
+      // Add language to exports

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();

+++ b/includes/features.locale.inc
@@ -0,0 +1,160 @@
+    if (array_key_exists($name, $language_list)) {

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 ''.

+++ b/includes/features.locale.inc
@@ -0,0 +1,160 @@
+    // Rebuild locale javascript hashs.
+    //_locale_rebuild_js($language->language);

Commented out code? :(

+++ b/includes/features.locale.inc
@@ -0,0 +1,160 @@
\ No newline at end of file

New line!

derhasi’s picture

Status: Needs work » Needs review
FileSize
5.38 KB

Oh, sure coder ... and your are right with your other comments too ;)

I attached a cleaned up patch.

helmo’s picture

Status: Needs review » Reviewed & tested by the community

Great, still works as expected :)

apaatsio’s picture

#8 works for me

wmostrey’s picture

The patch in #11 applies cleanly and works as expected. Great work Johannes!

DuaelFr’s picture

+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

/**
 * Implements hook_enable().
 */
function my_feature_enable() {
  l10n_update_modules_enabled(module_list());
}

but it does not work :/

mpotter’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1027e94

DuaelFr’s picture

Status: Fixed » Needs work

mpotter, it seems you forgot the include file :)

helmo’s picture

Status: Needs work » Needs review
FileSize
4.54 KB

New patch with the remaining includes/features.locale.inc file.

mpotter’s picture

Status: Needs review » Fixed

Ack. Just forgot to add the include file to git. Committed with include file f6ff815.

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