Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Albert Volkman’s picture

Status: Active » Needs review
Issue tags: +Configuration system
FileSize
25.83 KB

I'm sure this is going to need more work.

Status: Needs review » Needs work

The last submitted patch, language_cmi-1827038-1.patch, failed testing.

Albert Volkman’s picture

Status: Needs work » Needs review
FileSize
25.83 KB

Eep. *embarrassed*

Status: Needs review » Needs work

The last submitted patch, language_cmi-1827038-3.patch, failed testing.

japicoder’s picture

Assigned: Unassigned » japicoder

I take for review

Berdir’s picture

+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.phpundefined
@@ -42,8 +42,12 @@ function setUp() {
-    variable_set('language_test_language_types', TRUE);
-    variable_set('language_test_language_negotiation_info', TRUE);
+    config('language.test')
+      ->set('types', TRUE)
+      ->save();
+    config('language.test')
+      ->set('negotiation', TRUE)

Should be config()->set()->set()->save().

+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.phpundefined
@@ -382,7 +393,9 @@ protected function runTest($test) {
-      variable_set('language_test_domain', $test['language_test_domain']);
+      config('language.test')
+        ->set('domain', $test['language_test_domain'])

I haven't check what exactly this is doing but temporary variables which are only in test modules shoud use state(), not config().

japicoder’s picture

Status: Needs work » Needs review
FileSize
27.35 KB

Corrected some typo and a few vars not being corrected by the initial patch.
Corrected a "Call to undefined function theme()" error when doing clean install.

Status: Needs review » Needs work

The last submitted patch, 1827038-language_cmi-6.patch, failed testing.

japicoder’s picture

Thanks for your review, Berdir. I've added the changes that you suggest.

Anyway, I'm running in troubles with the installation, when it's installing the modules at field module it stops with a 500 server error. After debugging this, I can't figure why its happening, so y upload the last patch if someone can help me to find the error.

japicoder’s picture

More corrections to the patch and finally I found where is crashing at install, but don't understand why.

Problem is at this function, on bootstrap.inc

 function language_multilingual() {
-  // The "language_count" variable stores the number of enabled languages to
-  // avoid unnecessarily querying the database when building the list of
-  // enabled languages on monolingual sites.
-  return variable_get('language_count', 1) > 1;
+  // The "language.detection.count" variable stores the number of enabled
+  // languages to avoid unnecessarily querying the database when building the
+  // list of enabled languages on monolingual sites.
+  // Must use config instead of state to get the value because with state
+  // drupal install will not work.
+  return config('language.detection')->get('count') > 1;
 }

If revert the changes, using again the variable_get() function, installation goes right. If I use state() instead of config() function, it crashes when accessing /core/install.php, and if I leave as is on the patch, it works for the 4-5 first modules.

Can someone explain me what I'm doing wrong?

dagmar’s picture

@japicoder: I had the same problem during #1799440: Convert Filter variables to Configuration System.

The issue here is, make language.detection.count should not be part of the language module but system module. In fact maybe it can be a state instead of a config. See http://drupal.org/node/1790518

japicoder’s picture

@dagmar: thank you for your suggestions, after seeing http://drupal.org/node/1799440 I think it's now more clear to me and I have to try some improvements on the patch and see if now everything works as expected

japicoder’s picture

New revision, I've corrected some state calls and changed all the language.detection.count to state, but fails on install. This still needs work.

Cameron Tod’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1827038-language_cmi-13.patch, failed testing.

Cameron Tod’s picture

Could the install fails be related to the issues with the installer being worked on here? #1798732: Convert install_task, install_time and install_current_batch to use the state system

swentel’s picture

Indeed, there is a call to drupal_language_initialize() in install.core.inc which calls language_multilingual(). That function is converted to use the state() system in the patch which is not available yet. We'll have to wait for that other one to land to get this one forward.

dawehner’s picture

FileSize
23.66 KB

This is just a rerole.

aspilicious’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: -Configuration system

The last submitted patch, drupal-1827038-18.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review

#18: drupal-1827038-18.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, drupal-1827038-18.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review

#18: drupal-1827038-18.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Configuration system

The last submitted patch, drupal-1827038-18.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
23.6 KB

Re-rolling...

Status: Needs review » Needs work
Issue tags: -Configuration system

The last submitted patch, 1827038-language-cmi-25.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review

#25: 1827038-language-cmi-25.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1827038-language-cmi-25.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review

#25: 1827038-language-cmi-25.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Configuration system

The last submitted patch, 1827038-language-cmi-25.patch, failed testing.

Gábor Hojtsy’s picture

Tagging up with some tags.

penyaskito’s picture

The patch does not need a reroll, but some Language Negotiation tests are failing. I will try to find why.

Gábor Hojtsy’s picture

Restore lost tags.

penyaskito’s picture

Debugged the issue and found that there were some missing variable_get not changed. Trying to do that, I hit the #1862202: Objectify the language system wall, so maybe this should be postponed on that issue.

penyaskito’s picture

Totally useless, but here is my patch, interdiff, and the exception I finally got:

[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP Fatal error:  Call to a member function get() on a non-object in [...]core/includes/bootstrap.inc on line 2545
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP Stack trace:
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP   1. {main}() [...]index.php:0
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP   2. drupal_handle_request() [...]index.php:17
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP   3. Drupal\\Core\\DrupalKernel->boot() [...]core/includes/bootstrap.inc:2196
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP   4. Drupal\\Core\\DrupalKernel->initializeContainer() [...]core/lib/Drupal/Core/DrupalKernel.php:145
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP   5. Symfony\\Component\\DependencyInjection\\Container->get() [...]core/lib/Drupal/Core/DrupalKernel.php:302
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP   6. service_container_prod_->getConfig_FactoryService() [...]core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php:262
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP   7. Drupal\\Core\\Config\\ConfigFactory->__construct() [...]sites/default/files/php/service_container/service_container_prod_.php/faa37bd9338534cc942bc3cde5958900b8a3f630ccf915056fe9c929d58762ee.php:291
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP   8. Drupal\\Core\\Config\\ConfigFactory->enterContext() [...]core/lib/Drupal/Core/Config/ConfigFactory.php:64
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP   9. Drupal\\Core\\Config\\Context\\ConfigContext->init() [...]core/lib/Drupal/Core/Config/ConfigFactory.php:144
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP  10. Drupal\\Core\\Config\\Context\\ConfigContext->notify() [...]core/lib/Drupal/Core/Config/Context/ConfigContext.php:68
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP  11. Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch() [...]core/lib/Drupal/Core/Config/Context/ConfigContext.php:105
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP  12. Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch() [...]core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php:167
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP  13. Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch() [...]core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php:53
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP  14. call_user_func() [...]core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php:164
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP  15. Drupal\\locale\\LocaleConfigSubscriber->configContext() [...]core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php:0
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP  16. Drupal\\Core\\Language\\LanguageManager->getLanguage() [...]core/modules/locale/lib/Drupal/locale/LocaleConfigSubscriber.php:71
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP  17. Drupal\\Core\\Language\\LanguageManager->isMultilingual() [...]core/lib/Drupal/Core/Language/LanguageManager.php:89
[Sun Mar 10 17:53:23 2013] [error] [client 127.0.0.1] PHP  18. state() [...]core/lib/Drupal/Core/Language/LanguageManager.php:138
aspilicious’s picture

Status: Needs work » Needs review

lets run this

Status: Needs review » Needs work

The last submitted patch, 731724-222.patch, failed testing.

swentel’s picture

er #35 contains a completely different patch

swentel’s picture

also #1862202: Objectify the language system is going much further, so I think we can more or less close this one

- edit - rather wait until that one is done.

alexpott’s picture

Priority: Normal » Critical

This is a release blocker as we can't have a half deployable multilingual system through CMI

Gábor Hojtsy’s picture

Looking at the proposed patch, this is not actually an API change. Those who wanted to use the variables should have used the API functions to access them anyway.

jair’s picture

Issue tags: +Needs reroll

Needs reroll

tim.plunkett’s picture

Title: Convert language variables to cmi » Convert language variables to CMI
Assigned: penyaskito » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
8.02 KB

The last patch was from February 17th. A lot changed, so I'm just starting over. language_default is first.
The previous patch placed it into language.detection.yml, I'm not sure if that's correct.

Status: Needs review » Needs work

The last submitted patch, language-default-1827038-43.patch, failed testing.

tstoeckler’s picture

+++ b/core/lib/Drupal/Core/Language/LanguageManager.php
@@ -177,14 +177,8 @@ protected function getLanguageTypes() {
+  public function getLanguageDefault() {

I think getDefaultLanguage() would be a more intuitive name.

Also, considering that the previous patch was 300 KB I would prefer if we could do this in batches, i.e. one variable at a time or something.

Gábor Hojtsy’s picture

@tim.plunkett: well, the default language used to be a very integral part of language selection. Now that is configurable, so the detection may never consider the default language. Also, the default language may be applicable to other things, etc. all content/config entities created get that assigned when created unless configured otherwise. So the default language is applied to so many other things.

plach’s picture

Part of the language variables are addressed in #1862202: Objectify the language system. There we are introducing getLanguageDefault(), however I agree getDefaultLanguage() would be better.

vijaycs85’s picture

1. Created new issue #2078511: Rename getLanguageDefault() to getDefaultLanguage() for renaming method and postponed on this issue
2. Looks like getLanguageDefault() trying to get the default before static::$container is in place.

catch’s picture

Status: Needs work » Needs review
FileSize
1.19 KB

language_content_type variable is just cruft at this point since that was already converted. Here's an interim patch to clean that up.

ianthomas_uk’s picture

Status: Needs review » Reviewed & tested by the community

Agreed. I can see these being upgraded in node_update_8001() and then re-upgraded in following hooks until they are added to \Drupal::config('language.settings'). Therefore we don't need to manually delete them on uninstall.

RTBC.

ianthomas_uk’s picture

I should clarify my RTBC was for #49 for language_content_type_* only.

Many of the other variables have already been converted in other issues, the only remaining one that I could see that did not already have an open issue was language_default which I've split into #2108599: Convert language_default to CMI.

catch’s picture

Title: Convert language variables to CMI » Remove stale references to language_content_type variable
Gábor Hojtsy’s picture

Issue tags: +sprint

Tag on sprint for easier tracking.

catch’s picture

Assigned: Unassigned » webchick

Since Alex is away and it's my patch, assigning to webchick.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Oh, that's a far less scary patch than I was picturing from the title. :)

Committed and pushed to 8.x. Thanks!

Gábor Hojtsy’s picture

Issue tags: -sprint

Thanks!

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